@@ -494,46 +494,29 @@ CanType IRGenModule::getRuntimeReifiedType(CanType type) {
494494Type IRGenModule::substOpaqueTypesWithUnderlyingTypes (Type type) {
495495 // Substitute away opaque types whose underlying types we're allowed to
496496 // assume are constant.
497- if (type->hasOpaqueArchetype ()) {
498- auto context = getMaximalTypeExpansionContext ();
499- return swift::substOpaqueTypesWithUnderlyingTypes (type, context);
500- }
501-
502- return type;
497+ auto context = getMaximalTypeExpansionContext ();
498+ return swift::substOpaqueTypesWithUnderlyingTypes (type, context);
503499}
504500
505501CanType IRGenModule::substOpaqueTypesWithUnderlyingTypes (CanType type) {
506502 return substOpaqueTypesWithUnderlyingTypes (static_cast <Type>(type))
507503 ->getCanonicalType ();
508504}
509505
510- SILType IRGenModule::substOpaqueTypesWithUnderlyingTypes (
511- SILType type, CanGenericSignature genericSig) {
506+ SILType IRGenModule::substOpaqueTypesWithUnderlyingTypes (SILType type) {
512507 // Substitute away opaque types whose underlying types we're allowed to
513508 // assume are constant.
514- if (type.getASTType ()->hasOpaqueArchetype ()) {
515- auto context = getMaximalTypeExpansionContext ();
516- return SILType::getPrimitiveType (
517- swift::substOpaqueTypesWithUnderlyingTypes (type.getASTType (), context),
518- type.getCategory ());
519- }
520-
521- return type;
509+ auto context = getMaximalTypeExpansionContext ();
510+ return SILType::getPrimitiveType (
511+ swift::substOpaqueTypesWithUnderlyingTypes (type.getASTType (), context),
512+ type.getCategory ());
522513}
523514
524- std::pair<CanType, ProtocolConformanceRef>
525- IRGenModule::substOpaqueTypesWithUnderlyingTypes (CanType type,
526- ProtocolConformanceRef conformance) {
527- // Substitute away opaque types whose underlying types we're allowed to
528- // assume are constant.
529- if (type->hasOpaqueArchetype ()) {
530- auto context = getMaximalTypeExpansionContext ();
531- return std::make_pair (
532- swift::substOpaqueTypesWithUnderlyingTypes (type, context),
533- swift::substOpaqueTypesWithUnderlyingTypes (conformance, context));
534- }
535-
536- return std::make_pair (type, conformance);
515+ ProtocolConformanceRef
516+ IRGenModule::substOpaqueTypesWithUnderlyingTypes (
517+ ProtocolConformanceRef conformance) {
518+ auto context = getMaximalTypeExpansionContext ();
519+ return swift::substOpaqueTypesWithUnderlyingTypes (conformance, context);
537520}
538521
539522
0 commit comments