LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
liveness::FlowGraph< EdgeLabel > Class Template Reference

Flow graph. More...

#include <flowgraph.hh>

Inheritance diagram for liveness::FlowGraph< EdgeLabel >:
Collaboration diagram for liveness::FlowGraph< EdgeLabel >:

Public Types

typedef FlowGraph< EdgeLabel > self_type
 Shorthand for the current class type.
typedef misc::directed_graph
< const assem::Instr
*, EdgeLabel > 
super_type
 Shorthand for superclass.
typedef
super_type::vertex_descriptor 
vertex_descriptor
typedef boost::graph_traits
< self_type >::vertex_iterator 
vertex_iter_type
 Iterator on the vertices of a directed_graph.
typedef boost::graph_traits
< self_type >
::adjacency_iterator 
neighb_iter_type
 Iterator on the neighbors of the vertex of a directed_graph.
typedef boost::graph_traits
< self_type >::edge_iterator 
edge_iter_type
 Iterator on the edges of a graph.

Public Member Functions

 FlowGraph (const std::string &name, const assem::Instrs &instrs)
const misc::timertimer_get () const
virtual void edge_add (const vertex_descriptor &v1, const vertex_descriptor &v2) override
 Add an edge between two vertices.
std::list< vertex_descriptortopological_sort () const
 Topological sort.
vertex_descriptor vertex_add (const const assem::Instr *&l)
 Add a vertex to the graph.
virtual std::ostream & print (std::ostream &ostr) const
virtual void print (std::string file) const
virtual std::ostream & epilogue_print (std::ostream &ostr) const
const std::string & name_get () const
void name_set (const std::string &name)

Protected Member Functions

virtual std::ostream & vertex_print (vertex_descriptor v, std::ostream &ostr) const
 Print the label of vertex of a graph.

Protected Attributes

Timer member.
misc::timer timer_
 Flowgraph timer.

Detailed Description

template<typename EdgeLabel = misc::empty>
class liveness::FlowGraph< EdgeLabel >

Flow graph.

Member Typedef Documentation

typedef boost::graph_traits<self_type>::edge_iterator misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::edge_iter_type
inherited

Iterator on the edges of a graph.

typedef boost::graph_traits<self_type>::adjacency_iterator misc::directed_graph< const assem::Instr * , EdgeLabel >::neighb_iter_type
inherited

Iterator on the neighbors of the vertex of a directed_graph.

template<typename EdgeLabel = misc::empty>
typedef FlowGraph<EdgeLabel> liveness::FlowGraph< EdgeLabel >::self_type

Shorthand for the current class type.

template<typename EdgeLabel = misc::empty>
typedef misc::directed_graph<const assem::Instr*, EdgeLabel> liveness::FlowGraph< EdgeLabel >::super_type

Shorthand for superclass.

template<typename EdgeLabel = misc::empty>
typedef super_type::vertex_descriptor liveness::FlowGraph< EdgeLabel >::vertex_descriptor
typedef boost::graph_traits<self_type>::vertex_iterator misc::directed_graph< const assem::Instr * , EdgeLabel >::vertex_iter_type
inherited

Iterator on the vertices of a directed_graph.

Constructor & Destructor Documentation

template<typename EdgeLabel >
liveness::FlowGraph< EdgeLabel >::FlowGraph ( const std::string &  name,
const assem::Instrs instrs 
)

References precondition.

Member Function Documentation

virtual void misc::directed_graph< const assem::Instr * , EdgeLabel >::edge_add ( const vertex_descriptor v1,
const vertex_descriptor v2 
)
overridevirtualinherited

Add an edge between two vertices.

Iterators.This is just a wrapper around boost::add_edge.

Implements misc::graph< boost::bidirectionalS, const assem::Instr *, EdgeLabel >.

virtual std::ostream& misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::epilogue_print ( std::ostream &  ostr) const
virtualinherited
const std::string& misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::name_get ( ) const
inherited

Graph name.

void misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::name_set ( const std::string &  name)
inherited
virtual std::ostream& misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::print ( std::ostream &  ostr) const
virtualinherited

Graph pretty printing.

virtual void misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::print ( std::string  file) const
virtualinherited
template<typename EdgeLabel >
const misc::timer & liveness::FlowGraph< EdgeLabel >::timer_get ( ) const
std::list<vertex_descriptor> misc::directed_graph< const assem::Instr * , EdgeLabel >::topological_sort ( ) const
inherited

Topological sort.

This version (algorithm 17.5 in Modern Compiler Implementation in ML, p. 390) is not the same as boost::topological_sort since the former works on directed acyclic graphs (DAGs) and the latter doesn't.

vertex_descriptor misc::graph< boost::bidirectionalS , const assem::Instr * , EdgeLabel >::vertex_add ( const const assem::Instr * &  l)
inherited

Add a vertex to the graph.

Graph manipulation.Just a wrapper around boost::add_vertex.

template<typename EdgeLabel >
std::ostream & liveness::FlowGraph< EdgeLabel >::vertex_print ( vertex_descriptor  v,
std::ostream &  ostr 
) const
protectedvirtual

Print the label of vertex of a graph.

Implements misc::graph< boost::bidirectionalS, const assem::Instr *, EdgeLabel >.

Member Data Documentation

template<typename EdgeLabel = misc::empty>
misc::timer liveness::FlowGraph< EdgeLabel >::timer_
protected

Flowgraph timer.


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