Skip to content

Commit 02bf6fd

Browse files
committed
Expose SPI to get type descriptor for Bundle(for:)
1 parent e8b08de commit 02bf6fd

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/swift/Runtime/Metadata.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4377,6 +4377,14 @@ void swift_getFieldAt(
43774377
void verifyMangledNameRoundtrip(const Metadata *metadata);
43784378
#endif
43794379

4380+
#if !SWIFT_OBJC_INTEROP
4381+
4382+
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_SPI // SPI for swift-corelibs-foundation
4383+
ConstTargetMetadataPointer<swift::InProcess, TargetTypeContextDescriptor>
4384+
_swift_getTypeContextDescriptor(const Metadata *type);
4385+
4386+
#endif // !SWIFT_OBJC_INTEROP
4387+
43804388
} // end namespace swift
43814389

43824390
#pragma clang diagnostic pop

stdlib/public/runtime/Metadata.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,3 +3940,13 @@ void swift::verifyMangledNameRoundtrip(const Metadata *metadata) {
39403940
metadata, mangledName.c_str(), (const Metadata *)result);
39413941
}
39423942
#endif
3943+
3944+
#if !SWIFT_OBJC_INTEROP
3945+
3946+
// SPI for swift-corelibs-foundation
3947+
ConstTargetMetadataPointer<swift::InProcess, TargetTypeContextDescriptor>
3948+
swift::_swift_getTypeContextDescriptor(const Metadata *type) {
3949+
return type->getTypeContextDescriptor();
3950+
}
3951+
3952+
#endif // !SWIFT_OBJC_INTEROP

0 commit comments

Comments
 (0)