-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Remove useBridgedNSErrorConformances() #24872
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
slavapestov
merged 5 commits into
swiftlang:master
from
slavapestov:lazy-nserror-bridging-conformances
May 19, 2019
Merged
Remove useBridgedNSErrorConformances() #24872
slavapestov
merged 5 commits into
swiftlang:master
from
slavapestov:lazy-nserror-bridging-conformances
May 19, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci Please test |
@swift-ci Please test source compatibility |
@swift-ci Please test compiler performance |
Instead of visiting all types in the ExternalDefinitions list and queuing up their conformances, just emit conformances as needed when they are first referenced.
Just as with conformances, we can detect that a delayed function needs to be added to the queue from 'first principles' rather than walking the ExternalDefinitions list. This completely eliminates the ExternalDefinitions walk from SILGen, which has several advantages: - It fixes a source of quadratic behavior. In batch mode, type checking produces a list of external definitions shared across all primary files. Then, SILGen runs once per primary file, building a delayed emission map every time. - It allows SILGen to emit external definitions which only come into existence as a result of lazy conformance checking. Previously, anything that was added after SILGen performed its walk over the external definitions list would not be emitted.
This is just a stop-gap until getInterfaceType() becomes a request.
…Error conformers Previously we would synthesize this in Sema, but this no longer works when conformance checking is triggered by SILGen.
The walker in SILGenLazyConformance.cpp should be sufficient to catch any conformances needed at runtime, and after all the recent changes SILGen is now able to trigger lazy conformance checking and synthesis of fully-checked function bodies for accessors, which is enough to remove the explicit conformance checks from Sema in this case.
a7f7711
to
73f1b10
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #24267 and #24665.
Now that Sema builds fully type-checked bodies for accessors, we can remove Sema's explicit checking of
_StoredBridgedNSError
conformances in favor of SILGen trigger it via the lazy resolver mechanism.The only missing piece was then to change how SILGen emits external definitions; we now do it all on-demand, instead of walking the external definitions list, which solves an order dependency where definitions that were added to the external definitions list after SILGen had already walked the list would not be emitted at all.