File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1082,6 +1082,7 @@ void IRGenerator::emitTypeMetadataRecords() {
1082
1082
void IRGenerator::emitLazyDefinitions () {
1083
1083
while (!LazyTypeMetadata.empty () ||
1084
1084
!LazyTypeContextDescriptors.empty () ||
1085
+ !LazyOpaqueTypeDescriptors.empty () ||
1085
1086
!LazyFieldDescriptors.empty () ||
1086
1087
!LazyFunctionDefinitions.empty () ||
1087
1088
!LazyWitnessTables.empty ()) {
@@ -1106,6 +1107,11 @@ void IRGenerator::emitLazyDefinitions() {
1106
1107
emitLazyTypeContextDescriptor (*IGM.get (), type,
1107
1108
RequireMetadata_t (entry.IsMetadataUsed ));
1108
1109
}
1110
+ while (!LazyOpaqueTypeDescriptors.empty ()) {
1111
+ auto type = LazyOpaqueTypeDescriptors.pop_back_val ();
1112
+ CurrentIGMPtr IGM = getGenModule (type->getDeclContext ());
1113
+ IGM->emitOpaqueTypeDecl (type);
1114
+ }
1109
1115
while (!LazyFieldDescriptors.empty ()) {
1110
1116
NominalTypeDecl *type = LazyFieldDescriptors.pop_back_val ();
1111
1117
CurrentIGMPtr IGM = getGenModule (type->getDeclContext ());
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -parse-as-library -module-name=test -O -primary-file %s -emit-ir > %t.ll
2
+ // RUN: %FileCheck %s < %t.ll
3
+
4
+ protocol P { }
5
+
6
+ protocol Q {
7
+ associatedtype AT : P
8
+ func getAT( ) -> AT
9
+ }
10
+
11
+ private struct X : Q {
12
+ private struct Inner : P { }
13
+
14
+ // CHECK: @"$s4test1X33_58D62B15E5EAC1447430E52C74EAD489LLV5getATQryFQOMQ" = internal constant
15
+ func getAT( ) -> some P {
16
+ return Inner ( )
17
+ }
18
+ }
19
+
20
+ func testMe< T: Q > ( _ t: T ) {
21
+ _ = t. getAT ( )
22
+ }
23
+
24
+ func doIt( ) {
25
+ testMe ( X ( ) )
26
+ }
You can’t perform that action at this time.
0 commit comments