[5.0] Cherry-pick parseable interface generation improvements #21259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: Cherry-picks of [ParseableInterface] Standardize printing for accessors #20250, [ParseableInterface] Don't print conformances for non-public types #20656, [ParseableInterface] Don't print conformances from other modules #20657, and part of [ParseableInterface] Optimize parseable modules #20936 to bring 5.0's generation of swiftinterface files up to par with master. This will allow generating swiftinterfaces from projects using the Swift 5.0 compiler without having to build with a custom toolchain, which is important because we still don't have module stability yet.
Note that there are still known issues in this generation logic (for example, we get
lazy var
wrong in non-resilient structs).Scope: The changes here are mostly to AST printing, and around the use of an attribute that users can't type (
_hasStorage
).Issue: rdar://problem/43812188, mainly
Risk: Low, due to the limited scope. (AST printing isn't used for anything but diagnostics during a normal compile. The places where this affects generated interfaces are beneficial.)
Testing: Added compiler regression tests. On master, we also try to read in the generated swiftinterfaces, but 5.0 doesn't have the support for that.
Reviewed by: @harlanhaskins and I reviewed each other's changes here.