LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
callgraph::FundecGraph Class Reference

#include <fundec-graph.hh>

Inheritance diagram for callgraph::FundecGraph:
Collaboration diagram for callgraph::FundecGraph:

Public Types

typedef directed_graph
< ast::FunctionDec *, empty > 
self_type
typedef graph
< boost::bidirectionalS,
ast::FunctionDec *, empty > 
super_type
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

 FundecGraph ()
virtual ~FundecGraph ()
void fundec_add (ast::FunctionDec *f)
 Add a vertex to the graph, and attach a function definition to it.
void fundec_link (ast::FunctionDec *fu, ast::FunctionDec *fv)
vertex_descriptor hfundec_get (ast::FunctionDec *f) const
 Retrieve the vertex handle corresponding to a FunctionDec.
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 ast::FunctionDec *&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 Types

typedef std::map
< ast::FunctionDec
*, vertex_descriptor
hfundecs_type

Protected Member Functions

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

Protected Attributes

hfundecs_type hfundecs

Member Typedef Documentation

typedef boost::graph_traits<self_type>::edge_iterator misc::graph< boost::bidirectionalS , ast::FunctionDec * , empty >::edge_iter_type
inherited

Iterator on the edges of a graph.

typedef boost::graph_traits<self_type>::adjacency_iterator misc::directed_graph< ast::FunctionDec * , empty >::neighb_iter_type
inherited

Iterator on the neighbors of the vertex of a directed_graph.

typedef directed_graph<ast::FunctionDec * , empty > misc::directed_graph< ast::FunctionDec * , empty >::self_type
inherited
typedef graph<boost::bidirectionalS, ast::FunctionDec * , empty > misc::directed_graph< ast::FunctionDec * , empty >::super_type
inherited
typedef super_type::vertex_descriptor misc::directed_graph< ast::FunctionDec * , empty >::vertex_descriptor
inherited
typedef boost::graph_traits<self_type>::vertex_iterator misc::directed_graph< ast::FunctionDec * , empty >::vertex_iter_type
inherited

Iterator on the vertices of a directed_graph.

Constructor & Destructor Documentation

callgraph::FundecGraph::FundecGraph ( )
inline
callgraph::FundecGraph::~FundecGraph ( )
inlinevirtual

Member Function Documentation

virtual void misc::directed_graph< ast::FunctionDec * , empty >::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, ast::FunctionDec *, empty >.

virtual std::ostream& misc::graph< boost::bidirectionalS , ast::FunctionDec * , empty >::epilogue_print ( std::ostream &  ostr) const
virtualinherited
void callgraph::FundecGraph::fundec_add ( ast::FunctionDec f)
inline

Add a vertex to the graph, and attach a function definition to it.

References hfundecs, and misc::graph< boost::bidirectionalS, ast::FunctionDec *, empty >::vertex_add().

Referenced by callgraph::CallGraphVisitor::operator()().

void callgraph::FundecGraph::fundec_link ( ast::FunctionDec fu,
ast::FunctionDec fv 
)
inline

Create an edge between to vertices, identified by the FunctionDec attached to each of them.

References hfundecs.

Referenced by callgraph::CallGraphVisitor::operator()().

FundecGraph::vertex_descriptor callgraph::FundecGraph::hfundec_get ( ast::FunctionDec f) const
inline

Retrieve the vertex handle corresponding to a FunctionDec.

References assertion, and hfundecs.

const std::string& misc::graph< boost::bidirectionalS , ast::FunctionDec * , empty >::name_get ( ) const
inherited

Graph name.

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

Graph pretty printing.

virtual void misc::graph< boost::bidirectionalS , ast::FunctionDec * , empty >::print ( std::string  file) const
virtualinherited
std::list<vertex_descriptor> misc::directed_graph< ast::FunctionDec * , empty >::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 , ast::FunctionDec * , empty >::vertex_add ( const ast::FunctionDec * &  l)
inherited

Add a vertex to the graph.

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

Referenced by fundec_add().

std::ostream & callgraph::FundecGraph::vertex_print ( vertex_descriptor  v,
std::ostream &  ostr 
) const
inlineoverrideprotectedvirtual

Print the label of vertex of a graph.

Implements misc::graph< boost::bidirectionalS, ast::FunctionDec *, empty >.

Member Data Documentation

hfundecs_type callgraph::FundecGraph::hfundecs
protected

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