File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,16 @@ struct SILDeclRef {
397
397
398
398
bool canBeDynamicReplacement () const ;
399
399
400
+ bool isAutoDiffDerivativeFunction () const {
401
+ return derivativeFunctionIdentifier != nullptr ;
402
+ }
403
+
404
+ AutoDiffDerivativeFunctionIdentifier *
405
+ getAutoDiffDerivativeFunctionIdentifier () const {
406
+ assert (isAutoDiffDerivativeFunction ());
407
+ return derivativeFunctionIdentifier;
408
+ }
409
+
400
410
private:
401
411
friend struct llvm ::DenseMapInfo<swift::SILDeclRef>;
402
412
// / Produces a SILDeclRef from an opaque value.
Original file line number Diff line number Diff line change @@ -739,6 +739,9 @@ namespace {
739
739
isa<ConstructorDecl>(func.getDecl ())
740
740
? SILDeclRef::Kind::Allocator
741
741
: SILDeclRef::Kind::Func);
742
+ if (entry.getFunction ().isAutoDiffDerivativeFunction ())
743
+ declRef = declRef.asAutoDiffDerivativeFunction (
744
+ entry.getFunction ().getAutoDiffDerivativeFunctionIdentifier ());
742
745
addDiscriminator (flags, schema, declRef);
743
746
}
744
747
You can’t perform that action at this time.
0 commit comments