mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Remove PolymorphicFunctionType usage from materializeForSet emission, NFC
We always passed nullptr to getMaterializeForSetCallbackType(), so I'm assuming it is safe to just delete this bit of dead code. Now the only remaining usages of PolymorphicFunctionType in SIL are assertions ensuring that PolymorphicFunctionType doesn't end up there. There are still a number of usages of AllArchetypes though, via SILFunction::ContextGenericParams. Once @rjmccall finishes the heavy lifting on the IRGen side, it should be pretty easy to rip these out from SIL, too.
This commit is contained in:
@@ -456,9 +456,8 @@ collectIndicesFromParameters(SILGenFunction &gen, SILLocation loc,
|
||||
return result;
|
||||
}
|
||||
|
||||
static AnyFunctionType *getMaterializeForSetCallbackType(ASTContext &ctx,
|
||||
Type selfType,
|
||||
GenericParamList *genericParams) {
|
||||
static FunctionType *getMaterializeForSetCallbackType(ASTContext &ctx,
|
||||
Type selfType) {
|
||||
// (inout storage: Builtin.ValueBuffer,
|
||||
// inout self: Self,
|
||||
// @thick selfType: Self.Type) -> ()
|
||||
@@ -473,11 +472,7 @@ static AnyFunctionType *getMaterializeForSetCallbackType(ASTContext &ctx,
|
||||
FunctionType::ExtInfo extInfo = FunctionType::ExtInfo()
|
||||
.withRepresentation(FunctionType::Representation::Thin);
|
||||
|
||||
if (genericParams) {
|
||||
return PolymorphicFunctionType::get(input, result, genericParams, extInfo);
|
||||
} else {
|
||||
return FunctionType::get(input, result, extInfo);
|
||||
}
|
||||
return FunctionType::get(input, result, extInfo);
|
||||
}
|
||||
|
||||
static Type getSelfTypeForCallbackDeclaration(FuncDecl *witness) {
|
||||
@@ -508,8 +503,7 @@ SILFunction *MaterializeForSetEmitter::createCallback(SILFunction &F, GeneratorF
|
||||
/*discriminator*/ 0,
|
||||
/*context*/ Witness);
|
||||
closure.setType(getMaterializeForSetCallbackType(ctx,
|
||||
getSelfTypeForCallbackDeclaration(Witness),
|
||||
nullptr));
|
||||
getSelfTypeForCallbackDeclaration(Witness)));
|
||||
closure.getCaptureInfo().setGenericParamCaptures(true);
|
||||
|
||||
Mangle::Mangler mangler;
|
||||
|
||||
Reference in New Issue
Block a user