retdec
|
A CFG writer in the dot
format (graphviz
).
More...
#include <graphviz_cfg_writer.h>
Public Member Functions | |
virtual std::string | getId () const override |
Returns the ID of the writer. More... | |
virtual bool | emitCFG () override |
Emits the given CFG into the given output stream. More... | |
![]() | |
virtual | ~CFGWriter ()=default |
Static Public Member Functions | |
static ShPtr< CFGWriter > | create (ShPtr< CFG > cfg, std::ostream &out) |
Creates a new graphviz CFG writer. More... | |
Private Types | |
using | NodeSet = std::set< ShPtr< CFG::Node > > |
Set of nodes. More... | |
Private Member Functions | |
GraphvizCFGWriter (ShPtr< CFG > cfg, std::ostream &out) | |
Constructs a new graphviz CFG writer. More... | |
void | emitNodesByBreathFirstTraversal (ShPtr< CFG::Node > startNode, NodeSet &emittedNodes) |
Emits nodes starting from startNode by using a breadth-first traversal. More... | |
void | emitNode (ShPtr< CFG::Node > node) |
Emits the given node to out . More... | |
void | emitEdge (ShPtr< CFG::Edge > edge) |
Emits the given edge to out . More... | |
void | emitStmt (ShPtr< Statement > stmt) |
Emits the given statement to out . More... | |
Additional Inherited Members | |
![]() | |
using | NodeLabelMapping = std::map< ShPtr< CFG::Node >, std::string > |
Mapping between a node and its label. More... | |
![]() | |
CFGWriter (ShPtr< CFG > cfg, std::ostream &out) | |
Constructs a new writer. More... | |
![]() | |
ShPtr< CFG > | cfg |
CFG to be emitted. More... | |
std::ostream & | out |
Stream, where the resulting CFG will be emitted. More... | |
A CFG writer in the dot
format (graphviz
).
For more information on the dot
format, see http://www.graphviz.org/.
Use create() to create instances. Instances of this class have reference object semantics.
|
private |
Set of nodes.
|
overridevirtual |
Emits the given CFG into the given output stream.
The format of the written data depends on the subclass of this class.
true
if some code has been emitted, false
otherwise. Implements retdec::llvmir2hll::CFGWriter.
Emits the given edge to out
.
Emits the given node to out
.
|
private |
Emits nodes starting from startNode by using a breadth-first traversal.
Emitted nodes are inserted into emittedNodes. If a node is already in emittedNodes, it is not emitted.
Emits the given statement to out
.
|
overridevirtual |
Returns the ID of the writer.
Implements retdec::llvmir2hll::CFGWriter.