Skip to content

IRGen: Fix multi-payload enum lowering #17484

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

aschwaighofer
Copy link
Contributor

When we have a private resilient enum that is resilient because one of
its payloads is resilient but we have disabled resilience in the
context of lowering the enum as a class member (sigh), we must consider
it's payload's layout enum in the minimal domain (ignore the private
visibility) because we don't truly know the layout.

rdar://41308521

When we have a private resilient enum that is resilient because one of
its payloads is resilient but we have disabled resilience in the
context of lowering the enum as a class member (sigh), we must consider
it's payload's layout enum in the minimal domain (ignore the private
visibility) because we don't truly know the layout.

rdar://41308521
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple requested a review from slavapestov June 25, 2018 23:01
@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1772e77

// If we forced completely fragile layout we need to check the
// fixed-sized'ness in the minimal scope. Otherwise, we get wrong answer for
// private resilient enum types that have an resilient payload.
layoutScope = ResilienceExpansion::Minimal;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this should be part of TC.IGM.getResilienceExpansionForLayout()? Are there other places where we call it and get it wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I sunk the logic.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1772e77

This clearly satisfies the postcondition that 'Calling isResilient() with this scope will always return false.'
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1772e77

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1772e77

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1737b3a

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1737b3a

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 61c9276

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 61c9276

@aschwaighofer
Copy link
Contributor Author

Oh, right this test case is not going to work on linux where we don't have to expand resilient types in classes because of objc interrupt ...

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 38a731e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 38a731e

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f1519bb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f1519bb

@aschwaighofer aschwaighofer merged commit 886b01c into swiftlang:master Jun 27, 2018
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.

3 participants