@@ -279,62 +279,6 @@ EnumImplStrategy::emitResilientTagIndices(IRGenModule &IGM) const {
279279 }
280280}
281281
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-
338282namespace {
339283 // / Implementation strategy for singleton enums, with zero or one cases.
340284 class SingletonEnumImplStrategy final : public EnumImplStrategy {
@@ -2854,24 +2798,7 @@ namespace {
28542798 }
28552799 }
28562800 } 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);
28752802 return ;
28762803 }
28772804 }
0 commit comments