Otawa  0.10
otawa::display::CFGDrawer Class Reference

#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
 

Detailed Description

Author
G. Cavaignac

This class uses the odisplay library to make a visual graph from a CFG

Deprecated:
Use instead CFGOutput that provides a lot of customizations.

Constructor & Destructor Documentation

otawa::display::CFGDrawer::CFGDrawer ( CFG cfg,
Graph graph 
)

Creates a new drawer, and makes the graph with all the data needed.

Parameters
cfgCFG to print
graphconfigured 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.

Parameters
cfgCFG to print
propsproperties to apply to all the items of the graph (the Graph itself, Nodes, and Edges)
driverDriver 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().

virtual otawa::display::CFGDrawer::~CFGDrawer ( void  )
inlinevirtual

Member Function Documentation

void otawa::display::CFGDrawer::display ( void  )
virtual

This function only displays the graph made.

References _graph, otawa::display::Graph::display(), and make().

void otawa::display::CFGDrawer::make ( void  )
protectedvirtual
void otawa::display::CFGDrawer::onCall ( CFG cfg,
display::Node node 
)
protectedvirtual

This function is called to display a node representing a called CFG.

References otawa::CFG::label(), and otawa::display::TITLE.

Referenced by make().

void otawa::display::CFGDrawer::onEdge ( otawa::Edge cfg_edge,
otawa::display::Edge display_edge 
)
protectedvirtual

This function is called when a new Edge is created.

One can give properties to the edge

Parameters
cfg_edgeEdge of the CFG from which the Edge of the Graph has been made
display_edgeEdge 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().

void otawa::display::CFGDrawer::onEnd ( otawa::display::Graph graph)
protectedvirtual

This function is called when the CFG have been drawn.

One can add nodes, edges, or properties to the graph.

Parameters
graphgraph being drawn

Referenced by make().

void otawa::display::CFGDrawer::onInit ( PropList graph,
PropList nodes,
PropList edges 
)
protectedvirtual

This function is called before creating the Graph.

One can give some properties to the PropLists

Parameters
generalPropList for the default behaviour and properties of the graph
nodesPropList for the default properties of nodes
edgesPropList 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().

void otawa::display::CFGDrawer::onNode ( otawa::BasicBlock bb,
otawa::display::Node node 
)
protectedvirtual

This function is called when a new Node is created.

One can give properties to the node

Parameters
bbBasicBlock from which the node has been made
nodeNode 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().

Member Data Documentation

CFG* otawa::display::CFGDrawer::_cfg
protected

Referenced by CFGDrawer(), and make().

Graph* otawa::display::CFGDrawer::_graph
protected

Referenced by CFGDrawer(), display(), and make().

bool otawa::display::CFGDrawer::_made
protected

Referenced by make().


The documentation for this class was generated from the following files: