@@ -989,9 +989,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
989989 return addFunction (getDestroyStrongFunction (IGM));
990990 } else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
991991 IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
992+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
993+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
992994 if (auto *typeLayoutEntry =
993- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
994- /* useStructLayouts*/ true )) {
995+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
995996 auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
996997 ->getGenericSignature ();
997998 if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1017,9 +1018,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
10171018 return addFunction (getMemCpyFunction (IGM, concreteTI));
10181019 } else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
10191020 IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1021+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1022+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
10201023 if (auto *typeLayoutEntry =
1021- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1022- /* useStructLayouts*/ true )) {
1024+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
10231025 auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
10241026 ->getGenericSignature ();
10251027 if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1037,9 +1039,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
10371039 return addFunction (getAssignWithCopyStrongFunction (IGM));
10381040 } else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
10391041 IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1042+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1043+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
10401044 if (auto *typeLayoutEntry =
1041- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1042- /* useStructLayouts*/ true )) {
1045+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
10431046 auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
10441047 ->getGenericSignature ();
10451048 if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1057,9 +1060,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
10571060 return addFunction (getAssignWithTakeStrongFunction (IGM));
10581061 } else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
10591062 IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1063+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1064+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
10601065 if (auto *typeLayoutEntry =
1061- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1062- /* useStructLayouts*/ true )) {
1066+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
10631067 auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
10641068 ->getGenericSignature ();
10651069 if (typeLayoutEntry->layoutString (IGM, genericSig) ||
@@ -1077,9 +1081,10 @@ static void addValueWitness(IRGenModule &IGM, ConstantStructBuilder &B,
10771081 return addFunction (getInitWithCopyStrongFunction (IGM));
10781082 } else if (IGM.Context .LangOpts .hasFeature (Feature::LayoutStringValueWitnesses) &&
10791083 IGM.getOptions ().EnableLayoutStringValueWitnesses ) {
1084+ auto ty = boundGenericCharacteristics ? boundGenericCharacteristics->concreteType : concreteType;
1085+ auto &typeInfo = boundGenericCharacteristics ? *boundGenericCharacteristics->TI : concreteTI;
10801086 if (auto *typeLayoutEntry =
1081- concreteTI.buildTypeLayoutEntry (IGM, concreteType,
1082- /* useStructLayouts*/ true )) {
1087+ typeInfo.buildTypeLayoutEntry (IGM, ty, /* useStructLayouts*/ true )) {
10831088 auto genericSig = concreteType.getNominalOrBoundGenericNominal ()
10841089 ->getGenericSignature ();
10851090 if (typeLayoutEntry->layoutString (IGM, genericSig) ||
0 commit comments