Skip to content

[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

Merged
merged 6 commits into from
Jan 28, 2019

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jan 26, 2019

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.

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.
@DougGregor
Copy link
Member Author

More for @dcci to get excited about ;)

@DougGregor
Copy link
Member Author

@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.
@DougGregor
Copy link
Member Author

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 23886ba

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 23886ba

… 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.
@DougGregor
Copy link
Member Author

@swift-ci please test

2 similar comments
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a3b237

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

The failure on the simulator is unrelated.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 8458f10 into swiftlang:master Jan 28, 2019
@DougGregor DougGregor deleted the remote-ast-extensions branch January 28, 2019 17:06
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.

2 participants