@@ -288,30 +288,16 @@ void SILLinkerVisitor::visitProtocolConformance(
288
288
}
289
289
290
290
void SILLinkerVisitor::visitApplySubstitutions (SubstitutionMap subs) {
291
- for (auto &reqt : subs.getGenericSignature ()->getRequirements ()) {
292
- switch (reqt.getKind ()) {
293
- case RequirementKind::Conformance: {
294
- auto conformance = subs.lookupConformance (
295
- reqt.getFirstType ()->getCanonicalType (),
296
- cast<ProtocolDecl>(reqt.getSecondType ()->getAnyNominal ()))
297
- .getValue ();
298
-
299
- // Formally all conformances referenced in a function application are
300
- // used. However, eagerly visiting them all at this point leads to a
301
- // large blowup in the amount of SIL we read in, and we aren't very
302
- // systematic about laziness. For optimization purposes we can defer
303
- // reading in most conformances until we need them for devirtualization.
304
- // However, we *must* pull in shared clang-importer-derived conformances
305
- // we potentially use, since we may not otherwise have a local definition.
306
- if (mustDeserializeProtocolConformance (Mod, conformance)) {
307
- visitProtocolConformance (conformance, None);
308
- }
309
- break ;
310
- }
311
- case RequirementKind::Layout:
312
- case RequirementKind::SameType:
313
- case RequirementKind::Superclass:
314
- break ;
291
+ for (auto conformance : subs.getConformances ()) {
292
+ // Formally all conformances referenced in a function application are
293
+ // used. However, eagerly visiting them all at this point leads to a
294
+ // large blowup in the amount of SIL we read in, and we aren't very
295
+ // systematic about laziness. For optimization purposes we can defer
296
+ // reading in most conformances until we need them for devirtualization.
297
+ // However, we *must* pull in shared clang-importer-derived conformances
298
+ // we potentially use, since we may not otherwise have a local definition.
299
+ if (mustDeserializeProtocolConformance (Mod, conformance)) {
300
+ visitProtocolConformance (conformance, None);
315
301
}
316
302
}
317
303
}
0 commit comments