Skip to content

[Cherry-pick into next] [lldb] Remove accidental code duplication (NFC) #10395

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1275,29 +1275,9 @@ TypeSystemSwiftTypeRef::Canonicalize(swift::Demangle::Demangler &dem,
// Hit the safeguard limit.
return node;
}
default: {
llvm::SmallVector<NodePointer, 2> children;
bool changed = false;
for (NodePointer child : *node) {
NodePointer transformed = GetCanonicalNode(dem, child, flavor);
changed |= (child != transformed);
children.push_back(transformed);
}
if (changed) {
// Create a new node with the transformed children.
auto kind = node->getKind();
if (node->hasText())
node = dem.createNodeWithAllocatedText(kind, node->getText());
else if (node->hasIndex())
node = dem.createNode(kind, node->getIndex());
else
node = dem.createNode(kind);
for (NodePointer transformed_child : children)
node->addChild(transformed_child, dem);
}
default:
return node;
}
}
return node;
}

Expand Down