@@ -3534,16 +3534,6 @@ namespace {
3534
3534
3535
3535
if (HasDependentMetadata)
3536
3536
asImpl ().emitInitializeMetadata (IGF, metadata, false , collector);
3537
-
3538
- if (layoutStringsEnabled (IGM)) {
3539
- if (auto *layoutString = getLayoutString ()) {
3540
- auto layoutStringCast = IGF.Builder .CreateBitCast (layoutString,
3541
- IGM.Int8PtrTy );
3542
- IGF.Builder .CreateCall (
3543
- IGM.getGenericInstantiateLayoutStringFunctionPointer (),
3544
- {layoutStringCast, metadata});
3545
- }
3546
- }
3547
3537
});
3548
3538
}
3549
3539
@@ -5719,11 +5709,24 @@ namespace {
5719
5709
descriptor = emitPointerAuthSign (IGF, descriptor, authInfo);
5720
5710
}
5721
5711
5722
- return IGF.Builder .CreateCall (
5723
- getLayoutString () ?
5724
- IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer () :
5725
- IGM.getAllocateGenericValueMetadataFunctionPointer (),
5726
- {descriptor, arguments, templatePointer, extraSizeV});
5712
+ if (layoutStringsEnabled (IGM)) {
5713
+ auto *call = IGF.Builder .CreateCall (
5714
+ IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer (),
5715
+ {descriptor, arguments, templatePointer, extraSizeV});
5716
+
5717
+ if (auto *layoutString = getLayoutString ()) {
5718
+ auto layoutStringCast =
5719
+ IGF.Builder .CreateBitCast (layoutString, IGM.Int8PtrTy );
5720
+ IGF.Builder .CreateCall (
5721
+ IGM.getGenericInstantiateLayoutStringFunctionPointer (),
5722
+ {layoutStringCast, call});
5723
+ }
5724
+ return call;
5725
+ } else {
5726
+ return IGF.Builder .CreateCall (
5727
+ IGM.getAllocateGenericValueMetadataFunctionPointer (),
5728
+ {descriptor, arguments, templatePointer, extraSizeV});
5729
+ }
5727
5730
}
5728
5731
5729
5732
void flagUnfilledFieldOffset () {
@@ -6191,11 +6194,24 @@ namespace {
6191
6194
descriptor = emitPointerAuthSign (IGF, descriptor, authInfo);
6192
6195
}
6193
6196
6194
- return IGF.Builder .CreateCall (
6195
- getLayoutString () ?
6196
- IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer () :
6197
+ if (layoutStringsEnabled (IGM)) {
6198
+ auto *call = IGF.Builder .CreateCall (
6199
+ IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer (),
6200
+ {descriptor, arguments, templatePointer, extraSizeV});
6201
+
6202
+ if (auto *layoutString = getLayoutString ()) {
6203
+ auto layoutStringCast =
6204
+ IGF.Builder .CreateBitCast (layoutString, IGM.Int8PtrTy );
6205
+ IGF.Builder .CreateCall (
6206
+ IGM.getGenericInstantiateLayoutStringFunctionPointer (),
6207
+ {layoutStringCast, call});
6208
+ }
6209
+ return call;
6210
+ } else {
6211
+ return IGF.Builder .CreateCall (
6197
6212
IGM.getAllocateGenericValueMetadataFunctionPointer (),
6198
- {descriptor, arguments, templatePointer, extraSizeV});
6213
+ {descriptor, arguments, templatePointer, extraSizeV});
6214
+ }
6199
6215
}
6200
6216
6201
6217
bool hasTrailingFlags () {
0 commit comments