-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ABI] Mangle retroactive conformances as part of bound generic types. #14296
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
[ABI] Mangle retroactive conformances as part of bound generic types. #14296
Conversation
@swift-ci please test |
Build failed |
de1a652
to
ad5746f
Compare
Whoops. |
Build failed |
@swift-ci please test |
Build failed |
@swift-ci please test |
Build failed |
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.
LGTM, even all the fiddly remangling bits.
Build failed |
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.
lgtm!
This mangled name from a SwiftPM test:
illustrates that my attempt to make substitutions for some protocol-conformance productions (but not all of them) isn't going to work. |
A "retroactive" protocol conformance is a conformance that is provided by a module that is neither the module that defines the protocol nor the module that defines the conforming type. It is possible for such conformances to conflict at runtime, if defined in different modules that were not both visible to the compiler at the same time. When mangling a bound generic type, also mangle retroactive protocol conformances that were needed to satisfy the generic requirements of the generic type. This prevents name collisions between (e.g.) types formed using retroactive conformances from different modules. The impact on the size of the mangling is expected to be relatively small, because most conformances are not retroactive. Fixes the ABI part of rdar://problem/14375889.
ad5746f
to
28c489c
Compare
@swift-ci please smoke test and merge |
I'll come back to making protocol conformances substitutable in a bit. |
@swift-ci please smoke test and merge |
A "retroactive" protocol conformance is a conformance that is provided
by a module that is neither the module that defines the protocol nor
the module that defines the conforming type. It is possible for such
conformances to conflict at runtime, if defined in different modules
that were not both visible to the compiler at the same time.
When mangling a bound generic type, also mangle retroactive protocol
conformances that were needed to satisfy the generic requirements of
the generic type. This prevents name collisions between (e.g.) types
formed using retroactive conformances from different modules. The
impact on the size of the mangling is expected to be relatively small,
because most conformances are not retroactive.
Make this use of protocol-conformance substitutable, since we are likely to see the same retroactive conformances in multiple places in the same mangled name.
Fixes the ABI part of rdar://problem/14375889.