@@ -2322,7 +2322,7 @@ void SILSerializer::writeIndexTables() {
2322
2322
}
2323
2323
2324
2324
// SWIFT_ENABLE_TENSORFLOW
2325
- if (!DifferentiabilityWitnessOffset .empty ()) {
2325
+ if (!DifferentiabilityWitnessList .empty ()) {
2326
2326
writeIndexTable (S, List,
2327
2327
sil_index_block::SIL_DIFFERENTIABILITY_WITNESS_NAMES,
2328
2328
DifferentiabilityWitnessList);
@@ -2542,17 +2542,12 @@ writeSILDifferentiabilityWitness(const SILDifferentiabilityWitness &dw) {
2542
2542
DifferentiabilityWitnessOffset.push_back (Out.GetCurrentBitNo ());
2543
2543
2544
2544
auto *original = dw.getOriginalFunction ();
2545
- addReferencedSILFunction (original, /* DeclOnly*/ true );
2546
2545
IdentifierID jvpID = 0 ;
2547
2546
IdentifierID vjpID = 0 ;
2548
- if (auto *jvp = dw.getJVP ()) {
2549
- addReferencedSILFunction (jvp, /* DeclOnly*/ true );
2550
- jvpID = S.addUniquedStringRef (jvp->getName ());
2551
- }
2552
- if (auto *vjp = dw.getVJP ()) {
2553
- addReferencedSILFunction (vjp, /* DeclOnly*/ true );
2554
- vjpID = S.addUniquedStringRef (vjp->getName ());
2555
- }
2547
+ if (auto *jvp = dw.getJVP ())
2548
+ jvpID = addSILFunctionRef (jvp);
2549
+ if (auto *vjp = dw.getVJP ())
2550
+ vjpID = addSILFunctionRef (vjp);
2556
2551
SmallVector<unsigned , 8 > parameterAndResultIndices (
2557
2552
dw.getParameterIndices ()->begin (), dw.getParameterIndices ()->end ());
2558
2553
parameterAndResultIndices.append (dw.getResultIndices ()->begin (),
@@ -2569,7 +2564,7 @@ writeSILDifferentiabilityWitness(const SILDifferentiabilityWitness &dw) {
2569
2564
2570
2565
DifferentiabilityWitnessLayout::emitRecord (
2571
2566
Out, ScratchRecord, SILAbbrCodes[DifferentiabilityWitnessLayout::Code],
2572
- S. addUniquedStringRef (original-> getName () ),
2567
+ addSILFunctionRef (original),
2573
2568
toStableSILLinkage (dw.getLinkage ()),
2574
2569
dw.isSerialized (),
2575
2570
S.addGenericSignatureRef (dw.getDerivativeGenericSignature ()),
0 commit comments