diff options
Diffstat (limited to 'lib/AST/StmtViz.cpp')
-rw-r--r-- | lib/AST/StmtViz.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/AST/StmtViz.cpp b/lib/AST/StmtViz.cpp index 96b5218ba2f0..61fd750ccc83 100644 --- a/lib/AST/StmtViz.cpp +++ b/lib/AST/StmtViz.cpp @@ -15,7 +15,6 @@ #include "clang/AST/StmtGraphTraits.h" #include "clang/AST/Decl.h" #include "llvm/Support/GraphWriter.h" -#include <sstream> using namespace clang; @@ -23,8 +22,8 @@ void Stmt::viewAST() const { #ifndef NDEBUG llvm::ViewGraph(this,"AST"); #else - llvm::cerr << "Stmt::viewAST is only available in debug builds on " - << "systems with Graphviz or gv!\n"; + llvm::errs() << "Stmt::viewAST is only available in debug builds on " + << "systems with Graphviz or gv!\n"; #endif } @@ -33,26 +32,26 @@ template<> struct DOTGraphTraits<const Stmt*> : public DefaultDOTGraphTraits { static std::string getNodeLabel(const Stmt* Node, const Stmt* Graph, bool ShortNames) { - + #ifndef NDEBUG std::string OutSStr; llvm::raw_string_ostream Out(OutSStr); - + if (Node) Out << Node->getStmtClassName(); else Out << "<NULL>"; - - std::string OutStr = Out.str(); + + std::string OutStr = Out.str(); if (OutStr[0] == '\n') OutStr.erase(OutStr.begin()); - + // Process string output to make it nicer... for (unsigned i = 0; i != OutStr.length(); ++i) if (OutStr[i] == '\n') { // Left justify OutStr[i] = '\\'; OutStr.insert(OutStr.begin()+i+1, 'l'); } - + return OutStr; #else return ""; |