Skip to content

[lldb] Remove string demangling from DemangleCanonicalType #4038

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

Open
wants to merge 1 commit into
base: stable/20211026
Choose a base branch
from

Conversation

kastiglione
Copy link

DemangleCanonicalType has been unnecessarily doing a round trip of mangling and then demangling. This change happened in #3358.

When GetCanonicalDemangleTree returns a node tree without unresolved type aliases, the canonical type can be established directly from the node tree, without re-mangling and demangling.

@kastiglione
Copy link
Author

@swift-ci test

Comment on lines +1825 to +1831
if (ContainsUnresolvedTypeAlias(canonical)) {
// If this is a typealias defined in the expression evaluator,
// then we don't have debug info to resolve it from.
CompilerType ast_type =
ReconstructType({this, opaque_type}).GetCanonicalType();
canonical = GetCanonicalDemangleTree(
dem, ast_type.GetMangledTypeName().GetStringRef());
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic was inlined (copied) from GetCanonicalType in the same file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a static helper maybe?

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.

3 participants