Skip to content

Commit 0a292fd

Browse files
committed
Differentiation: correct the storage annotation for runtime functions
The runtime support functions are currently vended by swiftCore.{dll,dylib,so} rather than swift_Differentiation.{dll,dylib,so}. This corrects the annotations to indicate that reality. This never could have worked as declared in the first place. swift_Differentiation never links against swiftRuntime and swiftCore effectively whole-archives swiftRuntime into itself. This change is now reflecting that reality. If the desire is to move this (even on Darwin, where this may have already shipped and thus would break ABI), we could split up the swiftRuntime into swiftRuntime and swiftDifferentiationRuntime and link that as we do with the runtime into swiftCore.
1 parent 07f889f commit 0a292fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/runtime/AutoDiffSupport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ class AutoDiffLinearMapContext : public HeapObject {
3939
};
4040

4141
/// Creates a linear map context with a tail-allocated top-level subcontext.
42-
SWIFT_EXPORT_FROM(swift_Differentiation) SWIFT_CC(swift)
42+
SWIFT_RUNTIME_EXPORT SWIFT_CC(swift)
4343
AutoDiffLinearMapContext *swift_autoDiffCreateLinearMapContext(
4444
size_t topLevelSubcontextSize);
4545

4646
/// Returns the address of the tail-allocated top-level subcontext.
47-
SWIFT_EXPORT_FROM(swift_Differentiation) SWIFT_CC(swift)
47+
SWIFT_RUNTIME_EXPORT SWIFT_CC(swift)
4848
void *swift_autoDiffProjectTopLevelSubcontext(AutoDiffLinearMapContext *);
4949

5050
/// Allocates memory for a new subcontext.
51-
SWIFT_EXPORT_FROM(swift_Differentiation) SWIFT_CC(swift)
51+
SWIFT_RUNTIME_EXPORT SWIFT_CC(swift)
5252
void *swift_autoDiffAllocateSubcontext(AutoDiffLinearMapContext *, size_t size);
5353

5454
}

0 commit comments

Comments
 (0)