17 #include "llvm/Support/GraphWriter.h"
19 using namespace clang;
21 void Stmt::viewAST()
const {
23 llvm::ViewGraph(
this,
"AST");
25 llvm::errs() <<
"Stmt::viewAST is only available in debug builds on "
26 <<
"systems with Graphviz or gv!\n";
39 llvm::raw_string_ostream Out(OutSStr);
42 Out << Node->getStmtClassName();
46 std::string OutStr = Out.str();
47 if (OutStr[0] ==
'\n') OutStr.erase(OutStr.begin());
50 for (
unsigned i = 0; i != OutStr.length(); ++i)
51 if (OutStr[i] ==
'\n') {
53 OutStr.insert(OutStr.begin()+i+1,
'l');
static std::string getNodeLabel(const Stmt *Node, const Stmt *Graph)
ast_type_traits::DynTypedNode Node
DOTGraphTraits(bool isSimple=false)