16#include "llvm/Support/GraphWriter.h"
22 llvm::ViewGraph(
this,
"AST");
24 llvm::errs() <<
"Stmt::viewAST is only available in debug builds on "
25 <<
"systems with Graphviz or gv!\n";
38 llvm::raw_string_ostream Out(OutStr);
41 Out <<
Node->getStmtClassName();
45 if (OutStr[0] ==
'\n') OutStr.erase(OutStr.begin());
48 for (
unsigned i = 0; i != OutStr.length(); ++i)
49 if (OutStr[i] ==
'\n') {
51 OutStr.insert(OutStr.begin()+i+1,
'l');
Stmt - This represents one statement.
void viewAST() const
viewAST - Visualize an AST rooted at this Stmt* using GraphViz.
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
DOTGraphTraits(bool isSimple=false)
static std::string getNodeLabel(const Stmt *Node, const Stmt *Graph)