mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: Use getMaximalTypeExpansionContext()
This commit is contained in:
@@ -528,8 +528,7 @@ CanType IRGenModule::substOpaqueTypesWithUnderlyingTypes(CanType type) {
|
||||
// Substitute away opaque types whose underlying types we're allowed to
|
||||
// assume are constant.
|
||||
if (type->hasOpaqueArchetype()) {
|
||||
auto context = TypeExpansionContext::maximal(getSwiftModule(),
|
||||
getSILModule().isWholeModule());
|
||||
auto context = getMaximalTypeExpansionContext();
|
||||
return swift::substOpaqueTypesWithUnderlyingTypes(type, context,
|
||||
/*allowLoweredTypes=*/false);
|
||||
}
|
||||
@@ -542,8 +541,7 @@ SILType IRGenModule::substOpaqueTypesWithUnderlyingTypes(
|
||||
// Substitute away opaque types whose underlying types we're allowed to
|
||||
// assume are constant.
|
||||
if (type.getASTType()->hasOpaqueArchetype()) {
|
||||
auto context = TypeExpansionContext::maximal(getSwiftModule(),
|
||||
getSILModule().isWholeModule());
|
||||
auto context = getMaximalTypeExpansionContext();
|
||||
return SILType::getPrimitiveType(
|
||||
swift::substOpaqueTypesWithUnderlyingTypes(type.getASTType(), context,
|
||||
/*allowLoweredTypes=*/true),
|
||||
@@ -559,8 +557,7 @@ IRGenModule::substOpaqueTypesWithUnderlyingTypes(CanType type,
|
||||
// Substitute away opaque types whose underlying types we're allowed to
|
||||
// assume are constant.
|
||||
if (type->hasOpaqueArchetype()) {
|
||||
auto context = TypeExpansionContext::maximal(getSwiftModule(),
|
||||
getSILModule().isWholeModule());
|
||||
auto context = getMaximalTypeExpansionContext();
|
||||
return std::make_pair(
|
||||
swift::substOpaqueTypesWithUnderlyingTypes(type, context,
|
||||
/*allowLoweredTypes=*/false),
|
||||
|
||||
@@ -10,20 +10,12 @@
|
||||
|
||||
// RUN: %target-swift-reflection-dump %t/AssociatedTypeRequirements | %FileCheck %s
|
||||
|
||||
// This test is useless and was just relying on a bug where we didn't substitute away
|
||||
// known opaque return types in non-WMO mode.
|
||||
|
||||
// CHECK: ASSOCIATED TYPES:
|
||||
// CHECK: - AssociatedTypeRequirements.Foo : AssociatedTypeRequirements.myProto
|
||||
// CHECK-NEXT: typealias PerformReturn = opaque type symbolic reference
|
||||
// CHECK-NEXT: opaque type symbolic reference
|
||||
// CHECK-NEXT: (bound_generic_struct AssociatedTypeRequirements.Bar
|
||||
|
||||
// CHECK: conformance requirements:
|
||||
// CHECK-NEXT: AssociatedTypeRequirements.protoA
|
||||
// CHECK-NEXT: AssociatedTypeRequirements.protoB
|
||||
// CHECK-NEXT: testModB.testModBProtocol
|
||||
|
||||
// CHECK: same-type requirements:
|
||||
// CHECK-NEXT: A.AssociatedTypeRequirements.protoB.K = Sf (Swift.Float)
|
||||
// CHECK-NEXT: A.AssociatedTypeRequirements.protoA.T = 8testModB0aB7BStructV (testModB.testModBStruct)
|
||||
// CHECK-NEXT: typealias PerformReturn = AssociatedTypeRequirements.Bar<testModB.testModBStruct, Swift.Float>
|
||||
|
||||
import testModB
|
||||
|
||||
|
||||
Reference in New Issue
Block a user