Skip to content

Commit 30c9981

Browse files
committed
IRGen: Centralize check for local archetypes when outlining copy and destroy
1 parent 7fa676e commit 30c9981

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/IRGen/Outlining.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ irgen::getTypeAndGenericSignatureForManglingOutlineFunction(SILType type) {
138138
void TypeInfo::callOutlinedCopy(IRGenFunction &IGF, Address dest, Address src,
139139
SILType T, IsInitialization_t isInit,
140140
IsTake_t isTake) const {
141-
if (!IGF.IGM.getOptions().UseTypeLayoutValueHandling) {
141+
if (!T.hasLocalArchetype() &&
142+
!IGF.IGM.getOptions().UseTypeLayoutValueHandling) {
142143
OutliningMetadataCollector collector(IGF);
143144
if (T.hasArchetype()) {
144145
collectMetadataForOutlining(collector, T);
@@ -340,7 +341,8 @@ void TypeInfo::callOutlinedDestroy(IRGenFunction &IGF,
340341
if (IGF.IGM.getTypeLowering(T).isTrivial())
341342
return;
342343

343-
if (!IGF.IGM.getOptions().UseTypeLayoutValueHandling) {
344+
if (!T.hasLocalArchetype() &&
345+
!IGF.IGM.getOptions().UseTypeLayoutValueHandling) {
344346
OutliningMetadataCollector collector(IGF);
345347
if (T.hasArchetype()) {
346348
collectMetadataForOutlining(collector, T);

0 commit comments

Comments
 (0)