Otawa  0.10
CFGDrawer.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * Copyright (c) 2006, IRIT UPS.
4  *
5  * otawa/display/CFGDrawer.h -- display::CFGDrawer class interface.
6  */
7 #ifndef OTAWA_DISPLAY_CFGDRAWER_H
8 #define OTAWA_DISPLAY_CFGDRAWER_H
9 
10 #include <otawa/cfg.h>
11 #include <otawa/display/Driver.h>
12 #include <otawa/display/graphviz.h>
13 
14 namespace otawa { namespace display {
15 
16 class CFGDrawer {
17 protected:
20  bool _made;
21  virtual void onInit(PropList& graph, PropList& nodes, PropList& edges);
22  virtual void onNode(otawa::BasicBlock *bb, otawa::display::Node *node);
23  virtual void onEdge(otawa::Edge *cfg_edge, otawa::display::Edge *display_edge);
24  virtual void onCall(CFG *cfg, display::Node *node);
25  virtual void onEnd(otawa::display::Graph *graph);
26  virtual void make();
27 
28 public:
29  CFGDrawer(CFG *cfg, Graph *graph);
30  CFGDrawer(CFG *cfg, const PropList& props = PropList::EMPTY, Driver& driver = graphviz_driver);
31  virtual ~CFGDrawer(void) { }
32  virtual void display();
33 };
34 
35 } }
36 
37 #endif /*OTAWA_DISPLAY_CFGDRAWER_H*/
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
CFG * _cfg
Definition: CFGDrawer.h:18
Definition: CFGDrawer.h:16
virtual void onEdge(otawa::Edge *cfg_edge, otawa::display::Edge *display_edge)
This function is called when a new Edge is created.
Definition: CFGDrawer.cpp:182
bool _made
Definition: CFGDrawer.h:20
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
A driver provides facilities to display a graph.
Definition: Driver.h:47
virtual void onCall(CFG *cfg, display::Node *node)
This function is called to display a node representing a called CFG.
Definition: CFGDrawer.cpp:225
Driver & graphviz_driver
The graphviz driver.
Definition: display_graphviz.cpp:71
virtual ~CFGDrawer(void)
Definition: CFGDrawer.h:31
CFGDrawer(CFG *cfg, Graph *graph)
Creates a new drawer, and makes the graph with all the data needed.
Definition: CFGDrawer.cpp:30
Definition: Graph.h:60
This class represents edges in the CFG representation.
Definition: Edge.h:33
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
virtual void make()
Principal function.
Definition: CFGDrawer.cpp:62
Graph * _graph
Definition: CFGDrawer.h:19
This a list of properties.
Definition: PropList.h:63
virtual void display()
This function only displays the graph made.
Definition: CFGDrawer.cpp:100
virtual void onNode(otawa::BasicBlock *bb, otawa::display::Node *node)
This function is called when a new Node is created.
Definition: CFGDrawer.cpp:127
A graph provides facilities to display a graph.
Definition: Graph.h:76
virtual void onInit(PropList &graph, PropList &nodes, PropList &edges)
This function is called before creating the Graph.
Definition: CFGDrawer.cpp:113
virtual void onEnd(otawa::display::Graph *graph)
This function is called when the CFG have been drawn.
Definition: CFGDrawer.cpp:218
Definition: Graph.h:50