swift
7c384f8b - [AutoDiff] SILGen derivative function thunks must not be transparent. (#27752)

Commit
5 years ago
[AutoDiff] SILGen derivative function thunks must not be transparent. (#27752) SILGen generates thunks for derivative functions registered via `@differentiable` and `@differentiating` attributes. The thunks have a canonical, consistent naming (currently based on the original function name and parameter indices) that TBDGen can also generate via `SILDeclRef::mangle`. These SILGen derivative function thunks must not be transparent; otherwise, the functions will be inlined during MandatoryInlining and will not be exposed publicly. This bug was discovered as a DeadFunctionElimination crash: `function_ref` instructions referencing transparent derivative thunks had their referenced functions set to null by MandatoryInling and became invalid.
Author
Parents
Loading