llvm.org GIT mirror llvm / 18f6a2a
[MS Demangler] Add a helper function to print a Node as a string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349359 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 8 months ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
234234
235235 virtual void output(OutputStream &OS, OutputFlags Flags) const = 0;
236236
237 std::string toString() const;
238
237239 private:
238240 NodeKind Kind;
239241 };
110110 default:
111111 break;
112112 }
113 }
114
115 std::string Node::toString() const {
116 OutputStream OS;
117 initializeOutputStream(nullptr, nullptr, OS, 1024);
118 this->output(OS, llvm::ms_demangle::OF_Default);
119 OS << '\0';
120 return {OS.getBuffer()};
113121 }
114122
115123 void TypeNode::outputQuals(bool SpaceBefore, bool SpaceAfter) const {}