-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.0] Incorporate recent fixes for demangling to metadata #20166
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
DougGregor
merged 15 commits into
swiftlang:swift-5.0-branch
from
DougGregor:demangle-fixes-5.0
Oct 30, 2018
Merged
[5.0] Incorporate recent fixes for demangling to metadata #20166
DougGregor
merged 15 commits into
swiftlang:swift-5.0-branch
from
DougGregor:demangle-fixes-5.0
Oct 30, 2018
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
When performing the round-tripping verification for mangled type names, make sure we resolve symbolic references to something user-comprehensible that can be meaningfully rem angled. Part of rdar://problem/37551850. (cherry picked from commit cae1c8c)
When searching the superclasses at runtime, e.g., to find a suitable protocol conformance record, also consider the superclasses of CF types, which were recorded in the metadata but otherwise unused. (cherry picked from commit c5e226b)
…rameter flags’ bit. There are some cases where the AST’s notion of what constitutes function parameter flags differ from the ABI notion. Specifically, these are @escaping and @autoclosure, which are both modeled as types in the ABI. Teach IRGen to look at the ABI’s version of function parameter flags when determining whether to pass parameter flags to swift_getFunctionType([0-3])?. Without this fix, we would end up with mismatches between the function types built by IRGen and those built from mangled names. Part of rdar://problem/37551850. (cherry picked from commit 5fa92dc)
(cherry picked from commit 0d5513c)
@autoclosure is currently represented in mangled names, but the demangle-to-metadata path did not handle it. Add basic support for it so we can round-trip. (cherry picked from commit 7d88a7d)
(cherry picked from commit 1f2f90e)
…ata. The instantiation of an Objective-C class or definition of an Objective-C category can depend (at runtime) on Swift metadata, which is triggered (only) by mangled name round-trip verification. Teach the JIT to call the registration functions for Objective-C classes and categories after we’ve called all of the metadata registration functions. (cherry picked from commit 705cfa4)
…ype reference. The root generic parameter of an associated type reference in a generic requirement is not shifted by one. (cherry picked from commit 29a73bc)
Simplify calls to getAddrOfLLVMVariableOrGOTEquivalent() and getAddrOfLLVMVariable() by moving the computation of the alignment and default type into LinkEntity. Co-authored-by: Joe Groff <jgroff@apple.com> (cherry picked from commit 602b38e)
Co-authored-by: Joe Groff <jgroff@apple.com> (cherry picked from commit 8d3da66)
Extending the mangling of symbolic references to also include indirect symbolic references. This allows mangled names to refer to context descriptors (both type and protocol) not in the current source file. For now, only permit indirect symbolic references within the current module, because remote mirrors (among other things) is unable to handle relocations. Co-authored-by: Joe Groff <jgroff@apple.com> (cherry picked from commit 5b41ac1)
…names. (file)private entities are always available in the current file, so use symbolic references to refer to them within mangled names (always). This also eliminates problems stemming from our inability to demangle names referring to private entities, because we (intentionally) don't allow lookup for them. Should fix rdar://problem/44977236. (cherry picked from commit 54615ff)
…oduction. We were strangely excluding protocols from being symbolically referenced in the any-generic-type production, which meant that we could not resolve (e.g.) associated type references to private protocols at runtime. Allow protocol symbolic references in this position, and cope with it in the demangler. Fixes the rest of rdar://problem/44977236. (cherry picked from commit dafaabe)
Collapse the generic witness table, which was used only as a uniquing data structure during witness table instantiation, into the protocol conformance record. This colocates all of the constant protocol conformance metadata and makes it possible for us to recover the generic witness table from the conformance descriptor (including looking at the pattern itself). Rename swift_getGenericWitnessTable() to swift_instantiateWitnessTable() to make it clearer what its purpose is, and take the conformance descriptor directly. (cherry picked from commit a0e3258)
(cherry picked from commit a858e4f)
@swift-ci please test |
Build failed |
Build failed |
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.
Bring in the whole pile of fixes for the runtime's demangle-to-metadata path, including: