Skip to content

[SR-953] Implement Bundle(for: class): Expose SPI to get type descriptor. #16964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/swift/Runtime/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -4377,6 +4377,13 @@ void swift_getFieldAt(
void verifyMangledNameRoundtrip(const Metadata *metadata);
#endif

#if !SWIFT_OBJC_INTEROP

SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
const TypeContextDescriptor *swift_getTypeContextDescriptor(const Metadata *type);

#endif // !SWIFT_OBJC_INTEROP

} // end namespace swift

#pragma clang diagnostic pop
Expand Down
8 changes: 8 additions & 0 deletions stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3940,3 +3940,11 @@ void swift::verifyMangledNameRoundtrip(const Metadata *metadata) {
metadata, mangledName.c_str(), (const Metadata *)result);
}
#endif

#if !SWIFT_OBJC_INTEROP

const TypeContextDescriptor *swift::swift_getTypeContextDescriptor(const Metadata *type) {
return type->getTypeContextDescriptor();
}

#endif // !SWIFT_OBJC_INTEROP