Skip to content

Commit fa1f829

Browse files
committed
Also show the new conformance details in the default dump.
1 parent 9f4fc8c commit fa1f829

File tree

6 files changed

+88
-90
lines changed

6 files changed

+88
-90
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5636,11 +5636,9 @@ class PrintConformance : public PrintBase {
56365636
printTypeField(conformance->getType(), Label::always("type"));
56375637
printReferencedDeclField(conformance->getProtocol(),
56385638
Label::always("protocol"));
5639-
if (isTypeChecked()) {
5640-
printField(conformance->getSourceKind(), Label::always("source_kind"));
5641-
printFlag(conformance->isRetroactive(), "retroactive");
5642-
printIsolation(conformance->getIsolation());
5643-
}
5639+
printField(conformance->getSourceKind(), Label::optional("source_kind"));
5640+
printFlag(conformance->isRetroactive(), "retroactive");
5641+
printIsolation(conformance->getIsolation());
56445642
if (!Writer.isParsable())
56455643
printFlag(!shouldPrintDetails, "<details printed above>");
56465644
};

test/Frontend/debug-generic-signatures.swift

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ struct Basic: P1 {
3434
// Recursive conformances should have finite output.
3535

3636
// CHECK-LABEL: StructDecl name=Recur
37-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable")
38-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable")
37+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"{{.*}})
38+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"{{.*}})
3939
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"
4040
// CHECK-NEXT: (assoc_type req="A" type="Recur")
4141
// CHECK-NEXT: (assoc_type req="B" type="Recur")
4242
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
43-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"))
43+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"{{.*}}))
4444
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
45-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"))
45+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"{{.*}}))
4646
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
47-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))
47+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))
4848
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
49-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>)))
49+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>)))
5050
struct Recur: P2 {
5151
typealias A = Recur
5252
typealias B = Recur
@@ -55,29 +55,29 @@ struct Recur: P2 {
5555
// The full information about a conformance doesn't need to be printed twice.
5656

5757
// CHECK-LABEL: StructDecl name=NonRecur
58-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable")
59-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable")
58+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable"{{.*}})
59+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable"{{.*}})
6060
// CHECK-NEXT: (normal_conformance type="NonRecur" protocol="P2"
6161
// CHECK-NEXT: (assoc_type req="A" type="Recur")
6262
// CHECK-NEXT: (assoc_type req="B" type="Recur")
6363
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
64-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable"))
64+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable"{{.*}}))
6565
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
66-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable"))
66+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable"{{.*}}))
6767
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
6868
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"
6969
// CHECK-NEXT: (assoc_type req="A" type="Recur")
7070
// CHECK-NEXT: (assoc_type req="B" type="Recur")
7171
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
72-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"))
72+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"{{.*}}))
7373
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
74-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"))
74+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"{{.*}}))
7575
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
76-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))
76+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))
7777
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
78-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))))
78+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))))
7979
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
80-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>)))
80+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>)))
8181
struct NonRecur: P2 {
8282
typealias A = Recur
8383
typealias B = Recur
@@ -94,9 +94,9 @@ struct Generic<T> {}
9494
// CHECK-NEXT: (assoc_type req="A" type="T")
9595
// CHECK-NEXT: (value req="f()" witness="main.(file).Generic extension.f()@{{.*}}")
9696
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
97-
// CHECK-NEXT: (builtin_conformance type="Generic<T>" protocol="Copyable"))
97+
// CHECK-NEXT: (builtin_conformance type="Generic<T>" protocol="Copyable"{{.*}}))
9898
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
99-
// CHECK-NEXT: (builtin_conformance type="Generic<T>" protocol="Escapable"))
99+
// CHECK-NEXT: (builtin_conformance type="Generic<T>" protocol="Escapable"{{.*}}))
100100
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="Copyable"
101101
// CHECK-NEXT: (abstract_conformance protocol="Copyable"))
102102
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="Escapable"
@@ -119,9 +119,9 @@ class Super<T, U> {}
119119
// CHECK-NEXT: (assoc_type req="A" type="T")
120120
// CHECK-NEXT: (assoc_type req="B" type="T")
121121
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
122-
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Copyable"))
122+
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Copyable"{{.*}}))
123123
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
124-
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Escapable"))
124+
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Escapable"{{.*}}))
125125
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
126126
// CHECK-NEXT: (abstract_conformance protocol="P2"))
127127
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
@@ -135,8 +135,8 @@ extension Super: P2 where T: P2, U: P2 {
135135

136136
// Inherited/specialized conformances.
137137
// CHECK-LABEL: ClassDecl name=Sub
138-
// CHECK-NEXT: (builtin_conformance type="Sub" protocol="Copyable")
139-
// CHECK-NEXT: (builtin_conformance type="Sub" protocol="Escapable")
138+
// CHECK-NEXT: (builtin_conformance type="Sub" protocol="Copyable"{{.*}})
139+
// CHECK-NEXT: (builtin_conformance type="Sub" protocol="Escapable"{{.*}})
140140
// CHECK-NEXT: (inherited_conformance type="Sub" protocol="P2"
141141
// CHECK-NEXT: (specialized_conformance type="Super<NonRecur, Recur>" protocol="P2"
142142
// CHECK-NEXT: (substitution_map generic_signature=<T, U where T : P2, U : P2>
@@ -149,33 +149,33 @@ extension Super: P2 where T: P2, U: P2 {
149149
// CHECK-NEXT: (assoc_type req="A" type="Recur")
150150
// CHECK-NEXT: (assoc_type req="B" type="Recur")
151151
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
152-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable"))
152+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Copyable"{{.*}}))
153153
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
154-
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable"))
154+
// CHECK-NEXT: (builtin_conformance type="NonRecur" protocol="Escapable"{{.*}}))
155155
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
156156
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"
157157
// CHECK-NEXT: (assoc_type req="A" type="Recur")
158158
// CHECK-NEXT: (assoc_type req="B" type="Recur")
159159
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
160-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"))
160+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Copyable"{{.*}}))
161161
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
162-
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"))
162+
// CHECK-NEXT: (builtin_conformance type="Recur" protocol="Escapable"{{.*}}))
163163
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
164-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))
164+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))
165165
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
166-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))))
166+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))))
167167
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
168-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>))))
168+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>))))
169169
// CHECK-NEXT: (conformance type="U"
170-
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2" <details printed above>)))
170+
// CHECK-NEXT: (normal_conformance type="Recur" protocol="P2"{{.*}} <details printed above>)))
171171
// CHECK-NEXT: (<conditional requirements unable to be computed>)
172172
// CHECK-NEXT: (normal_conformance type="Super<T, U>" protocol="P2"
173173
// CHECK-NEXT: (assoc_type req="A" type="T")
174174
// CHECK-NEXT: (assoc_type req="B" type="T")
175175
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
176-
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Copyable"))
176+
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Copyable"{{.*}}))
177177
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
178-
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Escapable"))
178+
// CHECK-NEXT: (builtin_conformance type="Super<T, U>" protocol="Escapable"{{.*}}))
179179
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P2"
180180
// CHECK-NEXT: (abstract_conformance protocol="P2"))
181181
// CHECK-NEXT: (assoc_conformance type="Self.B" proto="P2"
@@ -188,44 +188,44 @@ class Sub: Super<NonRecur, Recur> {}
188188
// should work through SubstitutionMaps.
189189

190190
// CHECK-LABEL: StructDecl name=RecurGeneric
191-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable")
192-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable")
191+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable"{{.*}})
192+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable"{{.*}})
193193
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3"
194194
// CHECK-NEXT: (assoc_type req="A" type="RecurGeneric<T>")
195195
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
196-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable"))
196+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable"{{.*}}))
197197
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
198-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable"))
198+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable"{{.*}}))
199199
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P3"
200-
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3" <details printed above>)))
200+
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3"{{.*}} <details printed above>)))
201201
struct RecurGeneric<T: P3>: P3 {
202202
typealias A = RecurGeneric<T>
203203
}
204204

205205
// CHECK-LABEL: StructDecl name=Specialize
206-
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Copyable")
207-
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Escapable")
206+
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Copyable"{{.*}})
207+
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Escapable"{{.*}})
208208
// CHECK-NEXT: (normal_conformance type="Specialize" protocol="P3"
209209
// CHECK-NEXT: (assoc_type req="A" type="RecurGeneric<Specialize>")
210210
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
211-
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Copyable"))
211+
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Copyable"{{.*}}))
212212
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
213-
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Escapable"))
213+
// CHECK-NEXT: (builtin_conformance type="Specialize" protocol="Escapable"{{.*}}))
214214
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P3"
215215
// CHECK-NEXT: (specialized_conformance type="Specialize.A" protocol="P3"
216216
// CHECK-NEXT: (substitution_map generic_signature=<T where T : P3>
217217
// CHECK-NEXT: (substitution T ->
218218
// CHECK-NEXT: (struct_type decl="main.(file).Specialize@{{.*}}"))
219219
// CHECK-NEXT: (conformance type="T"
220-
// CHECK-NEXT: (normal_conformance type="Specialize" protocol="P3" <details printed above>)))
220+
// CHECK-NEXT: (normal_conformance type="Specialize" protocol="P3"{{.*}} <details printed above>)))
221221
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3"
222222
// CHECK-NEXT: (assoc_type req="A" type="RecurGeneric<T>")
223223
// CHECK-NEXT: (assoc_conformance type="Self" proto="Copyable"
224-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable"))
224+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Copyable"{{.*}}))
225225
// CHECK-NEXT: (assoc_conformance type="Self" proto="Escapable"
226-
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable"))
226+
// CHECK-NEXT: (builtin_conformance type="RecurGeneric<T>" protocol="Escapable"{{.*}}))
227227
// CHECK-NEXT: (assoc_conformance type="Self.A" proto="P3"
228-
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3" <details printed above>))))))
228+
// CHECK-NEXT: (normal_conformance type="RecurGeneric<T>" protocol="P3"{{.*}} <details printed above>))))))
229229
struct Specialize: P3 {
230230
typealias A = RecurGeneric<Specialize>
231231
}

0 commit comments

Comments
 (0)