@@ -247,7 +247,7 @@ namespace {
247
247
248
248
void assignWithCopy (IRGenFunction &IGF, Address dest, Address src, SILType T,
249
249
bool isOutlined) const override {
250
- if (isOutlined) {
250
+ if (isOutlined || T. hasLocalArchetype () ) {
251
251
Address destValue = projectValue (IGF, dest);
252
252
Address srcValue = projectValue (IGF, src);
253
253
asDerived ().emitValueAssignWithCopy (IGF, destValue, srcValue);
@@ -262,7 +262,7 @@ namespace {
262
262
263
263
void initializeWithCopy (IRGenFunction &IGF, Address dest, Address src,
264
264
SILType T, bool isOutlined) const override {
265
- if (isOutlined) {
265
+ if (isOutlined || T. hasLocalArchetype () ) {
266
266
Address destValue = projectValue (IGF, dest);
267
267
Address srcValue = projectValue (IGF, src);
268
268
asDerived ().emitValueInitializeWithCopy (IGF, destValue, srcValue);
@@ -277,7 +277,7 @@ namespace {
277
277
278
278
void assignWithTake (IRGenFunction &IGF, Address dest, Address src, SILType T,
279
279
bool isOutlined) const override {
280
- if (isOutlined) {
280
+ if (isOutlined || T. hasLocalArchetype () ) {
281
281
Address destValue = projectValue (IGF, dest);
282
282
Address srcValue = projectValue (IGF, src);
283
283
asDerived ().emitValueAssignWithTake (IGF, destValue, srcValue);
@@ -292,7 +292,7 @@ namespace {
292
292
293
293
void initializeWithTake (IRGenFunction &IGF, Address dest, Address src,
294
294
SILType T, bool isOutlined) const override {
295
- if (isOutlined) {
295
+ if (isOutlined || T. hasLocalArchetype () ) {
296
296
Address destValue = projectValue (IGF, dest);
297
297
Address srcValue = projectValue (IGF, src);
298
298
asDerived ().emitValueInitializeWithTake (IGF, destValue, srcValue);
@@ -307,7 +307,7 @@ namespace {
307
307
308
308
void destroy (IRGenFunction &IGF, Address existential, SILType T,
309
309
bool isOutlined) const override {
310
- if (isOutlined) {
310
+ if (isOutlined || T. hasLocalArchetype () ) {
311
311
Address valueAddr = projectValue (IGF, existential);
312
312
asDerived ().emitValueDestroy (IGF, valueAddr);
313
313
} else {
@@ -955,7 +955,7 @@ class OpaqueExistentialTypeInfo final :
955
955
956
956
void initializeWithCopy (IRGenFunction &IGF, Address dest, Address src,
957
957
SILType T, bool isOutlined) const override {
958
- if (isOutlined) {
958
+ if (isOutlined || T. hasLocalArchetype () ) {
959
959
llvm::Value *metadata = copyType (IGF, dest, src);
960
960
961
961
auto layout = getLayout ();
@@ -977,7 +977,7 @@ class OpaqueExistentialTypeInfo final :
977
977
978
978
void initializeWithTake (IRGenFunction &IGF, Address dest, Address src,
979
979
SILType T, bool isOutlined) const override {
980
- if (isOutlined) {
980
+ if (isOutlined || T. hasLocalArchetype () ) {
981
981
// memcpy the existential container. This is safe because: either the
982
982
// value is stored inline and is therefore by convention bitwise takable
983
983
// or the value is stored in a reference counted heap buffer, in which
0 commit comments