-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] Add entry point to canonicalize metadata. #32506
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
[Runtime] Add entry point to canonicalize metadata. #32506
Conversation
@swift-ci please test |
Build failed |
0b7141d
to
bb9a7f2
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
Build failed |
@swift-ci please test windows platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable.
The new function swift_getCanonicalSpecializedMetadata takes a metadata request, a prespecialized non-canonical metadata, and a cache as its arguments. The idea of the function is either to bless the provided prespecialized metadata as canonical if there is not currently a canonical metadata record for the type it describes or else to return the actual canonical metadata. When called, the metadata cache checks for a preexisting entry for this metadata. If none is found, the passed-in prespecialized metadata is added to the cache. Otherwise, the metadata record found in the cache is returned. rdar://problem/56995359
bb9a7f2
to
b0fc8da
Compare
@swift-ci please test |
Build failed |
@swift-ci please clean test linux |
The new function
swift_getCanonicalSpecializedMetadata
takes a metadata request, a prespecialized non-canonical metadata, and a cache as its arguments. The idea of the function is either to bless the provided prespecialized metadata as canonical if there is not currently a canonical metadata record for the type it describes or else to return the actual canonical metadata.When called, the metadata cache checks for a preexisting entry for this metadata. If none is found, the passed-in prespecialized metadata is added to the cache. Otherwise, the metadata record found in the cache is returned.
Until the ability to look through a type's canonical prespecializations is added,
swift_getCanonicalSpecializedMetadata
can't look through the canonical prespecializations that have been created for the generic nominal type in order to return it. Consequently, it must only be called with arguments which can be statically known not to have been possible to canonically prespecialize--for example, it would be sufficient to know that one of the generic arguments is from the module in which the non-canonical prespecialization is defined.rdar://problem/56995359