Skip to content

[ABI] [Mangling] Only look for retroactive conformances in conditional reqs #21450

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 4 commits into from
Dec 21, 2018

Conversation

jrose-apple
Copy link
Contributor

Previously, the mangler searched for retroactive conformances in any of a generic type's substitutions, but really we only care about the ones that affect the generic type's conformance, i.e. those that affect generic parameters. Refining this results in shorter mangled names involving instantiations of generic types.

Builds on top of #21448. The last commit is the interesting one.

Follow-up work for rdar://problem/46735592.

Fix to 510b64f. The mangling operator "HP" has to distinguish
between "protocol" and "protocol module", not between the presence
or absence of protocol-conformance-ref. New grammar:

    protocol-conformance-ref ::= protocol
    protocol-conformance-ref ::= protocol module 'HP'

rdar://problem/46735592, again
Previously, the mangler searched for retroactive conformances in /any/
of a generic type's substitutions, but really we only care about the
ones that affect the generic type's conformance, i.e. those that
affect generic parameters. Refining this results in shorter mangled
names involving instantiations of generic types.

Follow-up work for rdar://problem/46735592
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d5cbd3e

@jrose-apple
Copy link
Contributor Author

There are a whole pile of LLDB failures on the Linux tests and I don't think they're related to this change.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d5cbd3e

@jrose-apple
Copy link
Contributor Author

Same for the Mac bots.

@swift-ci Please smoke test

New(er) grammar:

    // same module as conforming type, or non-unique
    protocol-conformance-ref ::= protocol 'HP'
    // same module as protocol
    protocol-conformance-ref ::= protocol 'Hp'
    // retroactive
    protocol-conformance-ref ::= protocol module

We don't make use of this distinction anywhere yet, but we could in
the future.
@jrose-apple
Copy link
Contributor Author

New(er) grammar:

// same module as conforming type, or non-unique
protocol-conformance-ref ::= protocol 'HP'
// same module as protocol
protocol-conformance-ref ::= protocol 'Hp'
// retroactive
protocol-conformance-ref ::= protocol module

We don't make use of this distinction anywhere yet, but we could in the future.

@rjmccall Looks good now?

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

@jrose-apple jrose-apple merged commit 117dc27 into swiftlang:master Dec 21, 2018
@jrose-apple jrose-apple deleted the conditionally-retro branch December 21, 2018 02:02
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Dec 21, 2018
[ABI] [Mangling] Only look for retroactive conformances in conditional reqs

rdar://problem/46735592
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.

4 participants