@@ -3519,16 +3519,6 @@ namespace {
3519
3519
3520
3520
if (HasDependentMetadata)
3521
3521
asImpl ().emitInitializeMetadata (IGF, metadata, false , collector);
3522
-
3523
- if (layoutStringsEnabled (IGM)) {
3524
- if (auto *layoutString = getLayoutString ()) {
3525
- auto layoutStringCast = IGF.Builder .CreateBitCast (layoutString,
3526
- IGM.Int8PtrTy );
3527
- IGF.Builder .CreateCall (
3528
- IGM.getGenericInstantiateLayoutStringFunctionPointer (),
3529
- {layoutStringCast, metadata});
3530
- }
3531
- }
3532
3522
});
3533
3523
}
3534
3524
@@ -5641,11 +5631,24 @@ namespace {
5641
5631
descriptor = emitPointerAuthSign (IGF, descriptor, authInfo);
5642
5632
}
5643
5633
5644
- return IGF.Builder .CreateCall (
5645
- getLayoutString () ?
5646
- IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer () :
5647
- IGM.getAllocateGenericValueMetadataFunctionPointer (),
5648
- {descriptor, arguments, templatePointer, extraSizeV});
5634
+ if (layoutStringsEnabled (IGM)) {
5635
+ auto *call = IGF.Builder .CreateCall (
5636
+ IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer (),
5637
+ {descriptor, arguments, templatePointer, extraSizeV});
5638
+
5639
+ if (auto *layoutString = getLayoutString ()) {
5640
+ auto layoutStringCast =
5641
+ IGF.Builder .CreateBitCast (layoutString, IGM.Int8PtrTy );
5642
+ IGF.Builder .CreateCall (
5643
+ IGM.getGenericInstantiateLayoutStringFunctionPointer (),
5644
+ {layoutStringCast, call});
5645
+ }
5646
+ return call;
5647
+ } else {
5648
+ return IGF.Builder .CreateCall (
5649
+ IGM.getAllocateGenericValueMetadataFunctionPointer (),
5650
+ {descriptor, arguments, templatePointer, extraSizeV});
5651
+ }
5649
5652
}
5650
5653
5651
5654
void flagUnfilledFieldOffset () {
@@ -6113,11 +6116,24 @@ namespace {
6113
6116
descriptor = emitPointerAuthSign (IGF, descriptor, authInfo);
6114
6117
}
6115
6118
6116
- return IGF.Builder .CreateCall (
6117
- getLayoutString () ?
6118
- IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer () :
6119
+ if (layoutStringsEnabled (IGM)) {
6120
+ auto *call = IGF.Builder .CreateCall (
6121
+ IGM.getAllocateGenericValueMetadataWithLayoutStringFunctionPointer (),
6122
+ {descriptor, arguments, templatePointer, extraSizeV});
6123
+
6124
+ if (auto *layoutString = getLayoutString ()) {
6125
+ auto layoutStringCast =
6126
+ IGF.Builder .CreateBitCast (layoutString, IGM.Int8PtrTy );
6127
+ IGF.Builder .CreateCall (
6128
+ IGM.getGenericInstantiateLayoutStringFunctionPointer (),
6129
+ {layoutStringCast, call});
6130
+ }
6131
+ return call;
6132
+ } else {
6133
+ return IGF.Builder .CreateCall (
6119
6134
IGM.getAllocateGenericValueMetadataFunctionPointer (),
6120
- {descriptor, arguments, templatePointer, extraSizeV});
6135
+ {descriptor, arguments, templatePointer, extraSizeV});
6136
+ }
6121
6137
}
6122
6138
6123
6139
bool hasTrailingFlags () {
0 commit comments