-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Remote AST] Resolve extension context descriptors to demangle trees. #22150
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
Conversation
Read the extended context mangled name from an extension context descriptor so we can form a proper demangle tree for extensions. For example, this allows types nested within extensions of types from different modules to be found.
More for @dcci to get excited about ;) |
@swift-ci please smoke test |
Protocol references are interesting because we have to deal with the low bit indicating whether we have a reference to an Objective-C protocol. Factor out this logic for later re-use.
When reading a mangled name, make sure to cope with embedded null bytes that show up in symbolic references. When demangling such a name, handle symbolic references.
Translate the metadata for the generic requirements of an extension context into a demangle tree that is associated with the demangling of an extension. Teach the ASTDemangler how to handle class layout constraints as well. With this, RemoteAST can resolve types nested within most constrained extensions.
@swift-ci please test |
1 similar comment
@swift-ci please test |
Build failed |
Build failed |
… rather than clearing it out completely. This is better hygiene, although it doesn’t matter right now.
The “string length” primitive was validating the string data as valid UTF-8 to get the length. However, mangled names, which get read by this operation, are not always valid UTF-8. Just count the bytes until a ‘0’ and don’t validate.
@swift-ci please test |
Build failed |
@swift-ci please smoke test and merge |
The failure on the simulator is unrelated. |
@swift-ci please smoke test and merge |
Read the extended context mangled name from an extension context descriptor
so we can form a proper demangle tree for extensions. For example, this allows
types nested within extensions of types from different modules to be found, as
well as finding types defined within constrained extensions.