@@ -989,9 +989,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
989
989
return addFunction (getDestroyStrongFunction (IGM));
990
990
} else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
991
991
IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
992
+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
993
+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
992
994
if (auto *typeLayoutEntry =
993
- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
994
- /* useStructLayouts*/ true )) {
995
+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
995
996
auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
996
997
->getGenericSignature ();
997
998
if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1017,9 +1018,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
1017
1018
return addFunction (getMemCpyFunction (IGM, concreteTI));
1018
1019
} else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
1019
1020
IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1021
+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1022
+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
1020
1023
if (auto *typeLayoutEntry =
1021
- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1022
- /* useStructLayouts*/ true )) {
1024
+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
1023
1025
auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
1024
1026
->getGenericSignature ();
1025
1027
if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1037,9 +1039,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
1037
1039
return addFunction (getAssignWithCopyStrongFunction (IGM));
1038
1040
} else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
1039
1041
IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1042
+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1043
+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
1040
1044
if (auto *typeLayoutEntry =
1041
- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1042
- /* useStructLayouts*/ true )) {
1045
+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
1043
1046
auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
1044
1047
->getGenericSignature ();
1045
1048
if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1057,9 +1060,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
1057
1060
return addFunction (getAssignWithTakeStrongFunction (IGM));
1058
1061
} else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
1059
1062
IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1063
+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1064
+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
1060
1065
if (auto *typeLayoutEntry =
1061
- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1062
- /* useStructLayouts*/ true )) {
1066
+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
1063
1067
auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
1064
1068
->getGenericSignature ();
1065
1069
if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1077,9 +1081,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
1077
1081
return addFunction (getInitWithCopyStrongFunction (IGM));
1078
1082
} else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
1079
1083
IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1084
+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1085
+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
1080
1086
if (auto *typeLayoutEntry =
1081
- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1082
- /* useStructLayouts*/ true )) {
1087
+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
1083
1088
auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
1084
1089
->getGenericSignature ();
1085
1090
if (typeLayoutEntry->layoutString (IGM, genericSig) ||
0 commit comments