@@ -279,62 +279,6 @@ EnumImplStrategy::emitResilientTagIndices(IRGenModule &IGM) const {
279
279
}
280
280
}
281
281
282
- void EnumImplStrategy::callOutlinedCopy (IRGenFunction &IGF,
283
- Address dest, Address src, SILType T,
284
- IsInitialization_t isInit,
285
- IsTake_t isTake) const {
286
- if (!IGF.IGM .getOptions ().UseTypeLayoutValueHandling ) {
287
- OutliningMetadataCollector collector (IGF);
288
- if (T.hasArchetype ()) {
289
- collectMetadataForOutlining (collector, T);
290
- }
291
- collector.emitCallToOutlinedCopy (dest, src, T, *TI, isInit, isTake);
292
- return ;
293
- }
294
-
295
- if (!T.hasArchetype ()) {
296
- // Call the outlined copy function (the implementation will call vwt in this
297
- // case).
298
- OutliningMetadataCollector collector (IGF);
299
- collector.emitCallToOutlinedCopy (dest, src, T, *TI, isInit, isTake);
300
- return ;
301
- }
302
-
303
- if (isInit == IsInitialization && isTake == IsTake) {
304
- return emitInitializeWithTakeCall (IGF, T, dest, src);
305
- } else if (isInit == IsInitialization && isTake == IsNotTake) {
306
- return emitInitializeWithCopyCall (IGF, T, dest, src);
307
- } else if (isInit == IsNotInitialization && isTake == IsTake) {
308
- return emitAssignWithTakeCall (IGF, T, dest, src);
309
- } else if (isInit == IsNotInitialization && isTake == IsNotTake) {
310
- return emitAssignWithCopyCall (IGF, T, dest, src);
311
- }
312
- llvm_unreachable (" unknown case" );
313
- }
314
-
315
- void EnumImplStrategy::callOutlinedDestroy (IRGenFunction &IGF,
316
- Address addr, SILType T) const {
317
- if (!IGF.IGM .getOptions ().UseTypeLayoutValueHandling ) {
318
- OutliningMetadataCollector collector (IGF);
319
- if (T.hasArchetype ()) {
320
- collectMetadataForOutlining (collector, T);
321
- }
322
- collector.emitCallToOutlinedDestroy (addr, T, *TI);
323
- return ;
324
- }
325
-
326
- if (!T.hasArchetype ()) {
327
- // Call the outlined copy function (the implementation will call vwt in this
328
- // case).
329
- OutliningMetadataCollector collector (IGF);
330
- collector.emitCallToOutlinedDestroy (addr, T, *TI);
331
- return ;
332
- }
333
-
334
- emitDestroyCall (IGF, T, addr);
335
- return ;
336
- }
337
-
338
282
namespace {
339
283
// / Implementation strategy for singleton enums, with zero or one cases.
340
284
class SingletonEnumImplStrategy final : public EnumImplStrategy {
@@ -549,7 +493,7 @@ namespace {
549
493
if (!getSingleton ()) return ;
550
494
if (!ElementsAreABIAccessible) {
551
495
emitAssignWithCopyCall (IGF, T, dest, src);
552
- } else if (isOutlined || T.hasLocalArchetype ()) {
496
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
553
497
dest = getSingletonAddress (IGF, dest);
554
498
src = getSingletonAddress (IGF, src);
555
499
getSingleton ()->assignWithCopy (
@@ -564,7 +508,7 @@ namespace {
564
508
if (!getSingleton ()) return ;
565
509
if (!ElementsAreABIAccessible) {
566
510
emitAssignWithTakeCall (IGF, T, dest, src);
567
- } else if (isOutlined || T.hasLocalArchetype ()) {
511
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
568
512
dest = getSingletonAddress (IGF, dest);
569
513
src = getSingletonAddress (IGF, src);
570
514
getSingleton ()->assignWithTake (
@@ -586,7 +530,7 @@ namespace {
586
530
if (!getSingleton ()) return ;
587
531
if (!ElementsAreABIAccessible) {
588
532
emitInitializeWithCopyCall (IGF, T, dest, src);
589
- } else if (isOutlined || T.hasLocalArchetype ()) {
533
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
590
534
dest = getSingletonAddress (IGF, dest);
591
535
src = getSingletonAddress (IGF, src);
592
536
getSingleton ()->initializeWithCopy (
@@ -601,7 +545,7 @@ namespace {
601
545
if (!getSingleton ()) return ;
602
546
if (!ElementsAreABIAccessible) {
603
547
emitInitializeWithTakeCall (IGF, T, dest, src);
604
- } else if (isOutlined || T.hasLocalArchetype ()) {
548
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
605
549
dest = getSingletonAddress (IGF, dest);
606
550
src = getSingletonAddress (IGF, src);
607
551
getSingleton ()->initializeWithTake (
@@ -657,7 +601,7 @@ namespace {
657
601
!getSingleton ()->isTriviallyDestroyable (ResilienceExpansion::Maximal)) {
658
602
if (!ElementsAreABIAccessible) {
659
603
emitDestroyCall (IGF, T, addr);
660
- } else if (isOutlined || T.hasLocalArchetype ()) {
604
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
661
605
getSingleton ()->destroy (IGF, getSingletonAddress (IGF, addr),
662
606
getSingletonType (IGF.IGM , T), isOutlined);
663
607
} else {
@@ -2810,7 +2754,7 @@ namespace {
2810
2754
}
2811
2755
if (!ElementsAreABIAccessible) {
2812
2756
return emitDestroyCall (IGF, T, addr);
2813
- } else if (isOutlined || T.hasLocalArchetype ()) {
2757
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
2814
2758
switch (CopyDestroyKind) {
2815
2759
case TriviallyDestroyable:
2816
2760
return ;
@@ -2854,24 +2798,7 @@ namespace {
2854
2798
}
2855
2799
}
2856
2800
} else {
2857
- if (!IGF.IGM .getOptions ().UseTypeLayoutValueHandling ) {
2858
- OutliningMetadataCollector collector (IGF);
2859
- if (T.hasArchetype ()) {
2860
- collectMetadataForOutlining (collector, T);
2861
- }
2862
- collector.emitCallToOutlinedDestroy (addr, T, *TI);
2863
- return ;
2864
- }
2865
-
2866
- if (!T.hasArchetype ()) {
2867
- // Call the outlined copy function (the implementation will call vwt
2868
- // in this case).
2869
- OutliningMetadataCollector collector (IGF);
2870
- collector.emitCallToOutlinedDestroy (addr, T, *TI);
2871
- return ;
2872
- }
2873
-
2874
- emitDestroyCall (IGF, T, addr);
2801
+ callOutlinedDestroy (IGF, addr, T);
2875
2802
return ;
2876
2803
}
2877
2804
}
@@ -3114,7 +3041,7 @@ namespace {
3114
3041
SILType T, bool isOutlined) const override {
3115
3042
if (!ElementsAreABIAccessible) {
3116
3043
emitAssignWithCopyCall (IGF, T, dest, src);
3117
- } else if (isOutlined || T.hasLocalArchetype ()) {
3044
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
3118
3045
emitIndirectAssign (IGF, dest, src, T, IsNotTake, isOutlined);
3119
3046
} else {
3120
3047
callOutlinedCopy (IGF, dest, src, T, IsNotInitialization, IsNotTake);
@@ -3125,7 +3052,7 @@ namespace {
3125
3052
SILType T, bool isOutlined) const override {
3126
3053
if (!ElementsAreABIAccessible) {
3127
3054
emitAssignWithTakeCall (IGF, T, dest, src);
3128
- } else if (isOutlined || T.hasLocalArchetype ()) {
3055
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
3129
3056
emitIndirectAssign (IGF, dest, src, T, IsTake, isOutlined);
3130
3057
} else {
3131
3058
callOutlinedCopy (IGF, dest, src, T, IsNotInitialization, IsTake);
@@ -3136,7 +3063,7 @@ namespace {
3136
3063
SILType T, bool isOutlined) const override {
3137
3064
if (!ElementsAreABIAccessible) {
3138
3065
emitInitializeWithCopyCall (IGF, T, dest, src);
3139
- } else if (isOutlined || T.hasLocalArchetype ()) {
3066
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
3140
3067
emitIndirectInitialize (IGF, dest, src, T, IsNotTake, isOutlined);
3141
3068
} else {
3142
3069
callOutlinedCopy (IGF, dest, src, T, IsInitialization, IsNotTake);
@@ -3147,7 +3074,7 @@ namespace {
3147
3074
SILType T, bool isOutlined) const override {
3148
3075
if (!ElementsAreABIAccessible) {
3149
3076
emitInitializeWithTakeCall (IGF, T, dest, src);
3150
- } else if (isOutlined || T.hasLocalArchetype ()) {
3077
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
3151
3078
emitIndirectInitialize (IGF, dest, src, T, IsTake, isOutlined);
3152
3079
} else {
3153
3080
callOutlinedCopy (IGF, dest, src, T, IsInitialization, IsTake);
@@ -4972,7 +4899,7 @@ namespace {
4972
4899
SILType T, bool isOutlined) const override {
4973
4900
if (!ElementsAreABIAccessible) {
4974
4901
emitAssignWithCopyCall (IGF, T, dest, src);
4975
- } else if (isOutlined || T.hasLocalArchetype ()) {
4902
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
4976
4903
emitIndirectAssign (IGF, dest, src, T, IsNotTake, isOutlined);
4977
4904
} else {
4978
4905
callOutlinedCopy (IGF, dest, src, T, IsNotInitialization, IsNotTake);
@@ -4983,7 +4910,7 @@ namespace {
4983
4910
SILType T, bool isOutlined) const override {
4984
4911
if (!ElementsAreABIAccessible) {
4985
4912
emitAssignWithTakeCall (IGF, T, dest, src);
4986
- } else if (isOutlined || T.hasLocalArchetype ()) {
4913
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
4987
4914
emitIndirectAssign (IGF, dest, src, T, IsTake, isOutlined);
4988
4915
} else {
4989
4916
callOutlinedCopy (IGF, dest, src, T, IsNotInitialization, IsTake);
@@ -4994,7 +4921,7 @@ namespace {
4994
4921
SILType T, bool isOutlined) const override {
4995
4922
if (!ElementsAreABIAccessible) {
4996
4923
emitInitializeWithCopyCall (IGF, T, dest, src);
4997
- } else if (isOutlined || T.hasLocalArchetype ()) {
4924
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
4998
4925
emitIndirectInitialize (IGF, dest, src, T, IsNotTake, isOutlined);
4999
4926
} else {
5000
4927
callOutlinedCopy (IGF, dest, src, T, IsInitialization, IsNotTake);
@@ -5005,7 +4932,7 @@ namespace {
5005
4932
SILType T, bool isOutlined) const override {
5006
4933
if (!ElementsAreABIAccessible) {
5007
4934
emitInitializeWithTakeCall (IGF, T, dest, src);
5008
- } else if (isOutlined || T.hasLocalArchetype ()) {
4935
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
5009
4936
emitIndirectInitialize (IGF, dest, src, T, IsTake, isOutlined);
5010
4937
} else {
5011
4938
callOutlinedCopy (IGF, dest, src, T, IsInitialization, IsTake);
@@ -5039,7 +4966,7 @@ namespace {
5039
4966
}
5040
4967
if (!ElementsAreABIAccessible) {
5041
4968
emitDestroyCall (IGF, T, addr);
5042
- } else if (isOutlined || T.hasLocalArchetype ()) {
4969
+ } else if (isOutlined || T.hasParameterizedExistential ()) {
5043
4970
switch (CopyDestroyKind) {
5044
4971
case TriviallyDestroyable:
5045
4972
return ;
0 commit comments