Class SimpleDirectedGraph#

Inheritance Relationships#

Derived Types#

Class Documentation#

class SimpleDirectedGraph#

This provides some simple support mechanisms to create a graph of SimpleDirectedGraphNodes.

Subclassed by DependenceGraph, DependenceGraph, DominatorTreesAndDominanceFrontiers::ControlFlowGraph

Public Types

enum TraverseDirection#

This enum determines which direction to travel during a reachability pass.

Values:

enumerator FORWARD#

Reachability via successor edges

enumerator BACKWARD#

Reachability via predecessor edges

Public Functions

inline SimpleDirectedGraph()#
inline virtual ~SimpleDirectedGraph()#
inline std::set<SimpleDirectedGraphNode*> getNodes()#

get all the nodes in the graph

inline virtual void addNode(SimpleDirectedGraphNode *node)#

Add a node to the graph.

inline virtual void removeNode(SimpleDirectedGraphNode *node)#
inline virtual void removeLink(SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)#

Remove a linkt between “from” and “to”.

inline virtual void addLink(SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)#

Add a link to the graph between “from” and to “to”.

inline bool nodeExists(SimpleDirectedGraphNode *node)#

Check if a node containing data is in the graph.

inline bool linkExists(SimpleDirectedGraphNode *from, SimpleDirectedGraphNode *to)#

Check if a dependence is in the graph.

inline void printGraph()#
inline virtual void writeDot(char *filename)#
inline std::set<SimpleDirectedGraphNode*> getReachable(SimpleDirectedGraphNode *start, TraverseDirection dir)#

Protected Functions

inline virtual void _displayData(SimpleDirectedGraphNode *node, std::ostream &os)#

This virtual function can be overriden to control how data is presented by printGraph(). It defaults to simply outputting the data onto os.

Protected Attributes

std::set<SimpleDirectedGraphNode*> _nodes#