Skip to content

[Mangling] Introduce mangling for protocol conformances. #20230

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

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Nov 1, 2018

Introduce complete mangling for references to protocol conformances:

  • Mangle requirements of conditional conformances when present.
  • Mangle conformance access paths for generic environment-dependent
    conformances (currently unused)
  • Abstract protocol conformance references so we can introduce
    symbolic references for them.
  • Improve retroactive conformance mangling in a few ways:
    • Use the new, more-complete "protocol conformance" mangling
    • Consider conditional requirements when determining whether to mangle a retroactive conformance
    • Consider conformances within an overlay to be non-retroactive for types defined in an Objective-C module corresponding to the overlay

Introduce complete mangling for references to protocol conformances:

* Mangle requirements of conditional conformances when present.
* Mangle conformance access paths for generic environment-dependent
  conformances.
* Abstract protocol conformance references so we can introduce
  symbolic references for them.
…mangling

Change the retroactive conformance mangling to use the new
any-protocol-conformance mangling, which maintains more information about
concrete conformances. Specifically, it maintains conformance information
for conditional requirements. It also uses the protocol-conformance-ref
production that will eventually allow symbolic references to protocol
conformance descriptors.

While here, extend the “is retroactive” check during mangling to look for
retroactive conformances in the conditional requirements of a conformance.
The immediate conformance might not be retroactive, but its specialization
might depend on a retroactive conformance. Mangle these as “retroactive”, so
we can correctly reconstruct the exact type.
@DougGregor DougGregor force-pushed the mangled-protocol-conformances branch from 4fac77d to 5e232de Compare November 3, 2018 05:36
@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

When determining whether a given normal protocol conformance is “retroactive”,
consider an overlay module to be equivalent to its underlying Clang module.
Therefore, don’t classify conformances within the overlay as “retroactive”,
simplifying some common manglings (e.g., NSObject’s Hashable conformance is
no longer considered retroactive) and better capturing the intent.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

2 similar comments
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor changed the title [WIP] [Mangling] Introduce mangling for protocol conformances. [Mangling] Introduce mangling for protocol conformances. Nov 5, 2018
@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@DougGregor DougGregor merged commit 9464060 into swiftlang:master Nov 5, 2018
@DougGregor DougGregor deleted the mangled-protocol-conformances branch November 5, 2018 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant