mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a basic "re-mangler", which turns a parsed
demangling tree back into a mangled string. Also, extend the demangling API in a few obvious ways, and simplify testing for failure in the node-returning APIs by having them simply return null instead of a spurious Failure node. Also, preserve slightly more information in the demangling tree. The goal here is eventually to always allow a perfect round-trip through the demangler parse tree. This patch gets us close, but we're not quite there yet. Tests to follow. Swift SVN r24473
This commit is contained in:
@@ -32,6 +32,10 @@ static void printNode(llvm::raw_ostream &Out, const Node *node,
|
||||
unsigned depth) {
|
||||
// Indent two spaces per depth.
|
||||
Out.indent(depth * 2);
|
||||
if (!node) {
|
||||
Out << "<<NULL>>";
|
||||
return;
|
||||
}
|
||||
Out << "kind=" << getNodeKindString(node->getKind());
|
||||
if (node->hasText()) {
|
||||
Out << ", text=\"" << node->getText() << '\"';
|
||||
|
||||
Reference in New Issue
Block a user