File tree Expand file tree Collapse file tree 5 files changed +5
-33
lines changed Expand file tree Collapse file tree 5 files changed +5
-33
lines changed Original file line number Diff line number Diff line change @@ -827,7 +827,8 @@ class SILGenType : public TypeMemberVisitor<SILGenType> {
827
827
828
828
// Build a default witness table if this is a protocol.
829
829
if (auto protocol = dyn_cast<ProtocolDecl>(theType)) {
830
- if (!protocol->isObjC ())
830
+ if (!protocol->isObjC () &&
831
+ !protocol->hasFixedLayout ())
831
832
SGM.emitDefaultWitnessTable (protocol);
832
833
return ;
833
834
}
Original file line number Diff line number Diff line change @@ -678,7 +678,8 @@ void swift::finishTypeCheckingFile(SourceFile &SF) {
678
678
679
679
for (auto D : SF.Decls )
680
680
if (auto PD = dyn_cast<ProtocolDecl>(D))
681
- TC.inferDefaultWitnesses (PD);
681
+ if (!PD->hasFixedLayout ())
682
+ TC.inferDefaultWitnesses (PD);
682
683
}
683
684
684
685
void swift::performWholeModuleTypeChecking (SourceFile &SF) {
Original file line number Diff line number Diff line change @@ -254,19 +254,6 @@ func inoutResilientProtocol(_ x: inout OtherConformingType) {
254
254
inoutFunc ( & OtherConformingType. staticPropertyInExtension)
255
255
}
256
256
257
- // Protocol is not public -- make sure default witnesses have the right linkage
258
- protocol InternalProtocol {
259
- func noDefaultF( )
260
- func defaultG( )
261
- }
262
-
263
- extension InternalProtocol {
264
-
265
- // CHECK-LABEL: sil private [transparent] [thunk] @_T019protocol_resilience16InternalProtocolP8defaultGyyF
266
- // CHECK: return
267
- func defaultG( ) { }
268
- }
269
-
270
257
// CHECK-LABEL: sil_default_witness_table P {
271
258
// CHECK-NEXT: }
272
259
@@ -328,8 +315,3 @@ extension InternalProtocol {
328
315
// CHECK-NEXT: method #ReabstractSelfRefined.callback!setter.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcvs
329
316
// CHECK-NEXT: method #ReabstractSelfRefined.callback!materializeForSet.1: {{.*}} : @_T019protocol_resilience21ReabstractSelfRefinedP8callbackxxcvm
330
317
// CHECK-NEXT: }
331
-
332
- // CHECK-LABEL: sil_default_witness_table hidden InternalProtocol {
333
- // CHECK-NEXT: no_default
334
- // CHECK-NEXT: method #InternalProtocol.defaultG!1: {{.*}} : @_T019protocol_resilience16InternalProtocolP8defaultGyyF
335
- // CHECK-NEXT: }
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ extension R {
20
20
21
21
public struct S : R { }
22
22
23
- // CHECK-LABEL: sil private @_T021witness_accessibility1R{{.*}}AE18privateRequirementyyF
24
23
// CHECK-LABEL: sil private @_T021witness_accessibility1R{{.*}}E17publicRequirementyyF
25
24
// CHECK-LABEL: sil private @_T021witness_accessibility1R{{.*}}E19internalRequirementyyF
25
+ // CHECK-LABEL: sil private @_T021witness_accessibility1R{{.*}}AE18privateRequirementyyF
26
26
27
27
// CHECK-LABEL: sil private [transparent] [thunk] @_T021witness_accessibility1SVAA1R{{.*}}dELLP18privateRequirementyyFTW
28
28
// CHECK-LABEL: sil private [transparent] [thunk] @_T021witness_accessibility1SVAA1QA2aDP19internalRequirementyyFTW
Original file line number Diff line number Diff line change @@ -216,15 +216,3 @@ internal func donotEliminate() {
216
216
217
217
// CHECK-TESTING-LABEL: sil_witness_table [serialized] Adopt: Prot
218
218
// CHECK-TESTING: DeadWitness{{.*}}: @{{.*}}DeadWitness
219
-
220
- // CHECK-LABEL: sil_default_witness_table hidden Prot
221
- // CHECK: no_default
222
- // CHECK: no_default
223
- // CHECK: method #Prot.aliveDefaultWitness!1: {{.*}} : @{{.*}}aliveDefaultWitness
224
- // CHECK: no_default
225
-
226
- // CHECK-TESTING-LABEL: sil_default_witness_table Prot
227
- // CHECK-TESTING: no_default
228
- // CHECK-TESTING: no_default
229
- // CHECK-TESTING: method #Prot.aliveDefaultWitness!1: {{.*}} : @{{.*}}aliveDefaultWitness
230
- // CHECK-TESTING: method #Prot.DeadDefaultWitness!1: {{.*}} : @{{.*}}DeadDefaultWitness
You can’t perform that action at this time.
0 commit comments