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
[ABI] Associated conformance defaults #19391
[ABI] Associated conformance defaults #19391
Conversation
For a resilient conformance, emit the associated conformance accessor functions into the resilient witness table (keyed on the associated conformance descriptor) rather than in the fixed part of the witness table. This is another part of resilience for associated conformances, and a step toward defaults for associated conformances.
Default associated conformance accessors will be used in default witness tables to fill in associated conformances for defaulted associated types. Add (de|re|)mangling support for them and make them linking entities in IRGen.
When forming the default witness table for a resilient protocol, look for default associated conformances as well. These are identified by associated conformance requirements whose root associated type has a default type. For such requirements, we look for a conformance and record it as a default associated conformance. Emit a warning in cases where we don't find such a conformance, because the associated type and conformance *may* have been added with the intent of being resilient, and we can't know. This warning might be a terrible idea, but it is only enabled under -enable-resilience (which itself is hidden) and fires in one only place in the standard library (which seems legitimate), so we'll try it for now.
Referencing associated conformance witnesses via the index of the requirement in the requirement signature is inconvenient. Reference them by CanType/ProtocolDecl* instead.
For a resilient protocol that has defaulted associated types, emit default associated conformance witnesses that compute associated conformances based on that default witness. This completes the implementation of resilience protocols that add new, defaulted associated types, rdar://problem/44167982.
We *still* need a better way to model this, eventually, but this keeps the SIL parser limping along for default witness tables.
@swift-ci please test |
@swift-ci please benchmark |
@milseman this is the pull request that introduces a new warning into the build of the standard library:
We can add the conditional conformance of |
Build comment file:Code size: -O
Code size: -Osize
Code size: Swift libraries
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
Implement support for default associated conformance witnesses, as part of the default witness table, which includes:
Collection.SubSequence
resiliently.