diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-23 04:37:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-23 04:37:46 +0000 |
commit | bdff548e4dd577a72094d57b282de4e765643b96 (patch) | |
tree | 71c6617214b134968352b854c8f82ce8c89e1282 /lib/Analysis/CFGPrinter.cpp | |
parent | 405ce8db96f7a3a5a4c3da0f71d2ca54d30316f0 (diff) | |
download | external_llvm-bdff548e4dd577a72094d57b282de4e765643b96.zip external_llvm-bdff548e4dd577a72094d57b282de4e765643b96.tar.gz external_llvm-bdff548e4dd577a72094d57b282de4e765643b96.tar.bz2 |
eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFGPrinter.cpp')
-rw-r--r-- | lib/Analysis/CFGPrinter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Analysis/CFGPrinter.cpp b/lib/Analysis/CFGPrinter.cpp index 73f50d7..2364d98 100644 --- a/lib/Analysis/CFGPrinter.cpp +++ b/lib/Analysis/CFGPrinter.cpp @@ -44,19 +44,21 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits { if (ShortNames && !Node->getName().empty()) return Node->getNameStr() + ":"; - std::ostringstream Out; + std::string Str; + raw_string_ostream OS(Str); + if (ShortNames) { - WriteAsOperand(Out, Node, false); - return Out.str(); + WriteAsOperand(OS, Node, false); + return OS.str(); } if (Node->getName().empty()) { - WriteAsOperand(Out, Node, false); - Out << ":"; + WriteAsOperand(OS, Node, false); + OS << ":"; } - - Out << *Node; - std::string OutStr = Out.str(); + + OS << *Node; + std::string OutStr = OS.str(); if (OutStr[0] == '\n') OutStr.erase(OutStr.begin()); // Process string output to make it nicer... |