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(OutSStr);
41 Out <<
Node->getStmtClassName();
45 std::string OutStr = Out.str();
46 if (OutStr[0] ==
'\n') OutStr.erase(OutStr.begin());
49 for (
unsigned i = 0; i != OutStr.length(); ++i)
50 if (OutStr[i] ==
'\n') {
52 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)