Skip to content
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

[Serialization] Add a "nested types" lookup table for partial modules #7097

Merged

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: There's a class of errors in Serialization called "circularity issues", where declaration A in file A.swift depends on declaration B in file B.swift, and B also depends on A. A common case of this is when at least one of the declarations is nested, in which case a lookup to find that declaration needs to load all the members of the parent type. This commit sidesteps that issue specifically for nested types by creating a top-level, per-file table of nested types in the "partial modules". When a type is in the same module, we can then look it up without importing all other members of the parent type. This fixes a regression from Swift 3.0.
  • Scope: Affects non-WMO builds that include references to nested types across files in the same module.
  • Issue: SR-3707 / rdar://problem/30172856
  • Reviewed by: @DougGregor
  • Risk: Medium-low. This is a bunch of new code that changes something that happens in many builds, but there's at least a flag to turn it off.
  • Testing: Added compiler regression tests, verified that the original project now passes.

[Serialization] Add a "nested types" lookup table for partial modules
@jrose-apple jrose-apple added this to the Swift 3.1 milestone Jan 27, 2017
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - adbfbe9
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

Failure during checkout.

@swift-ci Please test Linux

@ematejska ematejska merged commit 13dd70a into apple:swift-3.1-branch Jan 30, 2017
@jrose-apple jrose-apple deleted the 3.1-nested-type-lookup-table branch January 30, 2017 18: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.

None yet

3 participants