22#ifndef GRAPHS_GRAPHWRITER_H
23#define GRAPHS_GRAPHWRITER_H
61template<
typename GraphType>
74 static_assert(std::is_pointer<NodeRef>::value,
75 "FIXME: Currently GraphWriter requires the NodeRef type to be "
76 "a pointer.\nThe pointer usage should be moved to "
77 "DOTGraphTraits, and removed from GraphWriter itself.");
87 for (
unsigned i = 0;
EI !=
EE &&
i != 64; ++
EI, ++
i)
103 O2 <<
"|<s64>truncated...";
138 O <<
"digraph unnamed {\n";
141 O <<
"\trankdir=\"BT\";\n";
174 O <<
"\tNode" <<
static_cast<const void*
>(Node) <<
" [shape=record,";
224 for (;
i != e &&
i != 64; ++
i)
227 O <<
"<d" <<
i <<
">"
232 O <<
"|<d64>truncated...";
241 for (
unsigned i = 0;
EI !=
EE &&
i != 64; ++
EI, ++
i)
278 O <<
"\tNode" << ID <<
"[ ";
291 O <<
"<s" <<
i <<
">";
302 const std::string &
Attrs)
327template<
typename GraphType>
328std::ofstream &
WriteGraph(std::ofstream &O,
const GraphType &G,
344template <
typename GraphType>
354 std::cerr <<
"error opening file '" <<
Filename <<
"' for writing!\n";
362 std::cerr <<
" done. \n";
370template<
typename GraphType>
void emitSimpleNode(const void *ID, const std::string &Attr, const std::string &Label, unsigned NumEdgeSources=0, const std::vector< std::string > *EdgeSourceLabels=nullptr)
emitSimpleNode - Outputs a simple (non-record) node
void writeNode(NodeRef Node)
DOTGraphTraits< GraphType > DOTTraits
void emitEdge(const void *SrcNodeID, int SrcNodePort, const void *DestNodeID, int DestNodePort, const std::string &Attrs)
emitEdge - Output an edge from a simple node into the graph...
void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI)
GenericGraphTraits< GraphType > GTraits
bool isNodeHidden(NodeRef Node)
bool getEdgeSourceLabels(std::stringstream &O2, NodeRef Node)
typename GTraits::nodes_iterator node_iterator
void writeHeader(const std::string &Title)
typename GTraits::NodeRef NodeRef
typename GTraits::ChildIteratorType child_iterator
void writeGraph(const std::string &Title="")
std::ofstream & getOStream()
GraphWriter(std::ofstream &o, const GraphType &g, bool SN)
std::string EscapeStr(const std::string &Label)
void ViewGraph(const GraphType &G, const std::string &name, bool ShortNames=false, GraphProgram::Name Program=GraphProgram::DOT)
llvm::IRBuilder IRBuilder
std::ofstream & WriteGraph(std::ofstream &O, const GraphType &G, bool ShortNames=false)
std::string getNodeLabel(const void *, const GraphType &)
static std::string getNodeIdentifierLabel(const void *, const GraphType &)
static std::string getNodeAttributes(const void *, const GraphType &)
static std::string getGraphName(const GraphType &)
static void addCustomGraphFeatures(const GraphType &, GraphWriter &)
static std::string getEdgeDestLabel(const void *, unsigned)
static std::string getEdgeSourceLabel(const void *, EdgeIter)
static bool edgeTargetsEdgeSource(const void *, EdgeIter)
static bool hasEdgeDestLabels()
static unsigned numEdgeDestLabels(const void *)
static EdgeIter getEdgeTarget(const void *, EdgeIter I)
static std::string getEdgeAttributes(const void *, EdgeIter, const GraphType &)
static bool isNodeHidden(const void *, const GraphType &)
static bool renderGraphFromBottomUp()
static std::string getNodeDescription(const void *, const GraphType &)
static std::string getGraphProperties(const GraphType &)
typename GraphType::UnknownGraphTypeError NodeRef