Skip to content

Commit 35c67f6

Browse files
committed
Eliminate an unnecessary use of ASTContext::getOrCreateCanonicalGenericEnvironment().
GenericSignature::createGenericEnvironment() is a better API for this.
1 parent cbccd2d commit 35c67f6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ static SILLocation getLocForValue(SILValue value) {
5454

5555
static GenericEnvironment *getGenericEnvironment(SILModule &Mod,
5656
CanSILFunctionType loweredTy) {
57-
auto *SM = Mod.getSwiftModule();
58-
auto &Ctx = loweredTy->getASTContext();
59-
auto *GSB = Ctx.getOrCreateGenericSignatureBuilder(
60-
loweredTy->getGenericSignature(), SM);
61-
auto *GenericEnv = Ctx.getOrCreateCanonicalGenericEnvironment(GSB, *SM);
62-
return GenericEnv;
57+
return loweredTy->getGenericSignature()->createGenericEnvironment(
58+
*Mod.getSwiftModule());
6359
}
6460

6561
/// Utility to determine if this is a large loadable type

0 commit comments

Comments
 (0)