Otawa
0.10
|
#include <otawa/display/CFGDrawer.h>
Public Member Functions | |
CFGDrawer (CFG *cfg, Graph *graph) | |
Creates a new drawer, and makes the graph with all the data needed. More... | |
CFGDrawer (CFG *cfg, const PropList &props=PropList::EMPTY, Driver &driver=graphviz_driver) | |
Creates a new drawer, and makes the graph with all the data needed. More... | |
virtual | ~CFGDrawer (void) |
virtual void | display () |
This function only displays the graph made. More... | |
Protected Member Functions | |
virtual void | onInit (PropList &graph, PropList &nodes, PropList &edges) |
This function is called before creating the Graph. More... | |
virtual void | onNode (otawa::BasicBlock *bb, otawa::display::Node *node) |
This function is called when a new Node is created. More... | |
virtual void | onEdge (otawa::Edge *cfg_edge, otawa::display::Edge *display_edge) |
This function is called when a new Edge is created. More... | |
virtual void | onCall (CFG *cfg, display::Node *node) |
This function is called to display a node representing a called CFG. More... | |
virtual void | onEnd (otawa::display::Graph *graph) |
This function is called when the CFG have been drawn. More... | |
virtual void | make () |
Principal function. More... | |
Protected Attributes | |
CFG * | _cfg |
Graph * | _graph |
bool | _made |
This class uses the odisplay library to make a visual graph from a CFG
Creates a new drawer, and makes the graph with all the data needed.
cfg | CFG to print |
graph | configured Graph in which one wish to create the nodes and the edges |
References _cfg, and otawa::cfgio::cfg().
otawa::display::CFGDrawer::CFGDrawer | ( | CFG * | cfg, |
const PropList & | props = PropList::EMPTY , |
||
Driver & | driver = graphviz_driver |
||
) |
Creates a new drawer, and makes the graph with all the data needed.
cfg | CFG to print |
props | properties to apply to all the items of the graph (the Graph itself, Nodes, and Edges) |
driver | Driver to use to create the graph. The default is graphviz_driver |
References _cfg, _graph, otawa::PropList::addProps(), otawa::cfgio::cfg(), otawa::display::Driver::newGraph(), onInit(), and otawa::display::Item::setProps().
|
inlinevirtual |
|
virtual |
This function only displays the graph made.
References _graph, otawa::display::Graph::display(), and make().
|
protectedvirtual |
Principal function.
It creates Nodes and Edges to put in the Graph, from the given CFG
cfg | source CFG |
References _cfg, _graph, _made, otawa::cfgio::bb(), otawa::Edge::CALL, otawa::cfgio::edge(), elm::genstruct::HashTable< K, T, H >::get(), otawa::display::Graph::newEdge(), otawa::display::Graph::newNode(), onCall(), onEdge(), onEnd(), onNode(), and elm::genstruct::HashTable< K, T, H >::put().
Referenced by display().
|
protectedvirtual |
This function is called to display a node representing a called CFG.
References otawa::CFG::label(), and otawa::display::TITLE.
Referenced by make().
|
protectedvirtual |
This function is called when a new Edge is created.
One can give properties to the edge
cfg_edge | Edge of the CFG from which the Edge of the Graph has been made |
display_edge | Edge of the Graph made. One can give properties to it |
References otawa::Edge::CALL, otawa::Edge::kind(), otawa::display::LABEL, otawa::Edge::NOT_TAKEN, otawa::display::Item::setProps(), otawa::display::STYLE, otawa::display::STYLE_DASHED, otawa::Edge::TAKEN, otawa::Edge::VIRTUAL, otawa::Edge::VIRTUAL_CALL, and otawa::Edge::VIRTUAL_RETURN.
Referenced by make().
|
protectedvirtual |
|
protectedvirtual |
This function is called before creating the Graph.
One can give some properties to the PropLists
general | PropList for the default behaviour and properties of the graph |
nodes | PropList for the default properties of nodes |
edges | PropList for the default properties of edges |
References otawa::Identifier< T >::add(), otawa::display::EXCLUDE, otawa::display::FONT_SIZE, otawa::INDEX, otawa::display::SHAPE, and otawa::display::ShapeStyle::SHAPE_MRECORD.
Referenced by CFGDrawer().
|
protectedvirtual |
This function is called when a new Node is created.
One can give properties to the node
bb | BasicBlock from which the node has been made |
node | Node made. One can give some properties to it |
References otawa::ot::address(), otawa::cfgio::bb(), otawa::display::BODY, otawa::FUNCTION_LABEL, otawa::LABEL, elm::StringBuffer::length(), otawa::display::Item::setProps(), otawa::display::SHAPE, otawa::display::ShapeStyle::SHAPE_MRECORD, otawa::display::TITLE, and elm::StringBuffer::toString().
Referenced by make().
|
protected |
Referenced by CFGDrawer(), and make().
|
protected |
Referenced by CFGDrawer(), display(), and make().
|
protected |
Referenced by make().