Eliminate an unnecessary use of ASTContext::getOrCreateCanonicalGenericEnvironment().

GenericSignature::createGenericEnvironment() is a better API for this.
This commit is contained in:
Doug Gregor
2017-05-11 16:34:39 -07:00
parent cbccd2d7f3
commit 35c67f6acf

View File

@@ -54,12 +54,8 @@ static SILLocation getLocForValue(SILValue value) {
static GenericEnvironment *getGenericEnvironment(SILModule &Mod,
CanSILFunctionType loweredTy) {
auto *SM = Mod.getSwiftModule();
auto &Ctx = loweredTy->getASTContext();
auto *GSB = Ctx.getOrCreateGenericSignatureBuilder(
loweredTy->getGenericSignature(), SM);
auto *GenericEnv = Ctx.getOrCreateCanonicalGenericEnvironment(GSB, *SM);
return GenericEnv;
return loweredTy->getGenericSignature()->createGenericEnvironment(
*Mod.getSwiftModule());
}
/// Utility to determine if this is a large loadable type