LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::Graph Class Reference

#include <Graph.h>

Collaboration diagram for llvm::Graph:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< Node *,
std::vector< graphListElement > > 
nodeMapTy
typedef nodeMapTy::iterator elementIterator
typedef nodeMapTy::const_iterator constElementIterator
typedef std::vector< graphListElementnodeList

Public Member Functions

 Graph ()
 Graph (std::vector< Node * > n, std::vector< Edge > e, Node *rt, Node *lt)
void addNode (Node *nd)
void addEdge (Edge ed, int w)
void addEdgeForce (Edge ed)
void setWeight (Edge ed)
void removeEdge (Edge ed)
void removeEdgeWithWt (Edge ed)
bool hasEdge (Edge ed)
bool hasEdgeAndWt (Edge ed)
std::vector< Node * > getSuccNodes (Node *nd)
int getNumberOfOutgoingEdges (Node *nd) const
std::vector< Node * > getPredNodes (Node *nd)
int getNumberOfIncomingEdges (Node *nd)
std::vector< Node * > getAllNodes () const
std::vector< Node * > getAllNodes ()
std::vector< Node * > reverseTopologicalSort ()
void reverseWts ()
void makeUnDirectional ()
void printGraph ()
void getBackEdges (std::vector< Edge > &be, std::map< Node *, int > &d)
nodeListsortNodeList (Node *par, nodeList &nl, std::vector< Edge > &be)
GraphgetMaxSpanningTree ()
nodeListgetNodeList (Node *nd)
nodeListgetSortedNodeList (Node *nd, std::vector< Edge > &be)
NodegetRoot ()
Node *const getRoot () const
NodegetExit ()
Node *const getExit () const
bool isRoot (Node *n) const
bool isLeaf (Node *n) const

Detailed Description

Definition at line 206 of file Graph.h.


Member Typedef Documentation

typedef nodeMapTy::const_iterator llvm::Graph::constElementIterator
 

Definition at line 243 of file Graph.h.

typedef nodeMapTy::iterator llvm::Graph::elementIterator
 

Definition at line 242 of file Graph.h.

typedef std::vector<graphListElement > llvm::Graph::nodeList
 

Definition at line 244 of file Graph.h.

typedef std::map<Node*, std::vector<graphListElement> > llvm::Graph::nodeMapTy
 

Definition at line 209 of file Graph.h.


Constructor & Destructor Documentation

llvm::Graph::Graph  )  [inline]
 

Definition at line 250 of file Graph.h.

Referenced by getMaxSpanningTree().

llvm::Graph::Graph std::vector< Node * >  n,
std::vector< Edge e,
Node rt,
Node lt
 

Definition at line 41 of file Graph.cpp.

References llvm::Edge::getFirst(), llvm::Edge::getRandId(), llvm::Edge::getSecond(), and llvm::Edge::getWeight().


Member Function Documentation

void llvm::Graph::addEdge Edge  ed,
int  w
 

Definition at line 187 of file Graph.cpp.

References llvm::findNodeInList(), llvm::Edge::getFirst(), llvm::Edge::getRandId(), and llvm::Edge::getSecond().

Referenced by getMaxSpanningTree(), and llvm::processGraph().

void llvm::Graph::addEdgeForce Edge  ed  ) 
 

Definition at line 205 of file Graph.cpp.

References llvm::Edge::getFirst(), llvm::Edge::getRandId(), llvm::Edge::getSecond(), and llvm::Edge::getWeight().

Referenced by llvm::addDummyEdges(), and makeUnDirectional().

void llvm::Graph::addNode Node nd  ) 
 

Definition at line 171 of file Graph.cpp.

References getAllNodes().

Referenced by getMaxSpanningTree().

vector< Node * > llvm::Graph::getAllNodes  ) 
 

Definition at line 317 of file Graph.cpp.

vector< Node * > llvm::Graph::getAllNodes  )  const
 

Definition at line 308 of file Graph.cpp.

Referenced by addNode(), llvm::getChords(), llvm::getCodeInsertions(), llvm::getEdgeIncrements(), getMaxSpanningTree(), llvm::inc_DFS(), makeUnDirectional(), llvm::printGraph(), printGraph(), llvm::removeTreeEdges(), reverseTopologicalSort(), and reverseWts().

void llvm::Graph::getBackEdges std::vector< Edge > &  be,
std::map< Node *, int > &  d
 

Referenced by llvm::getBBtrace(), and llvm::ProfilePaths::runOnFunction().

Node* const llvm::Graph::getExit  )  const [inline]
 

Definition at line 359 of file Graph.h.

Node* llvm::Graph::getExit  )  [inline]
 

Definition at line 358 of file Graph.h.

Referenced by llvm::addDummyEdges(), llvm::getCodeInsertions(), llvm::getPathFrmNode(), llvm::moveDummyCode(), and llvm::processGraph().

Graph * llvm::Graph::getMaxSpanningTree  ) 
 

Definition at line 341 of file Graph.cpp.

References addEdge(), addNode(), DEBUG, getAllNodes(), getNodeList(), getRoot(), llvm::Node::getWeight(), Graph(), llvm::printEdge(), printGraph(), llvm::printNode(), and llvm::Node::setWeight().

Referenced by llvm::processGraph().

nodeList& llvm::Graph::getNodeList Node nd  )  [inline]
 

Definition at line 341 of file Graph.h.

Referenced by llvm::getChords(), llvm::getCodeInsertions(), getMaxSpanningTree(), getNumberOfIncomingEdges(), llvm::getPathFrmNode(), getPredNodes(), getSuccNodes(), llvm::inc_DFS(), makeUnDirectional(), llvm::printGraph(), printGraph(), llvm::removeTreeEdges(), and reverseWts().

int llvm::Graph::getNumberOfIncomingEdges Node nd  ) 
 

Definition at line 294 of file Graph.cpp.

References EE, and getNodeList().

Referenced by llvm::getCodeInsertions().

int llvm::Graph::getNumberOfOutgoingEdges Node nd  )  const
 

Definition at line 268 of file Graph.cpp.

Referenced by llvm::getCodeInsertions().

vector< Node * > llvm::Graph::getPredNodes Node nd  ) 
 

Definition at line 281 of file Graph.cpp.

References EE, llvm::findNodeInList(), and getNodeList().

Node* const llvm::Graph::getRoot  )  const [inline]
 

Definition at line 355 of file Graph.h.

Node* llvm::Graph::getRoot  )  [inline]
 

Definition at line 354 of file Graph.h.

Referenced by llvm::addDummyEdges(), llvm::getCodeInsertions(), llvm::getEdgeIncrements(), getMaxSpanningTree(), llvm::getPathFrmNode(), llvm::moveDummyCode(), llvm::processGraph(), and llvm::valueAssignmentToEdges().

nodeList& llvm::Graph::getSortedNodeList Node nd,
std::vector< Edge > &  be
[inline]
 

Definition at line 347 of file Graph.h.

References sortNodeList().

Referenced by llvm::getEdgeIncrements(), and llvm::valueAssignmentToEdges().

vector< Node * > llvm::Graph::getSuccNodes Node nd  ) 
 

Definition at line 255 of file Graph.cpp.

References getNodeList().

bool llvm::Graph::hasEdge Edge  ed  ) 
 

Definition at line 140 of file Graph.cpp.

References llvm::findNodeInList(), llvm::Edge::getFirst(), llvm::Edge::getSecond(), and llvm::Edge::isNull().

Referenced by llvm::processGraph().

bool llvm::Graph::hasEdgeAndWt Edge  ed  ) 
 

Definition at line 156 of file Graph.cpp.

References llvm::Edge::getFirst(), llvm::Edge::getSecond(), llvm::Edge::getWeight(), and llvm::Edge::isNull().

Referenced by llvm::getChords(), llvm::getEdgeIncrements(), llvm::inc_DFS(), makeUnDirectional(), and llvm::removeTreeEdges().

bool llvm::Graph::isLeaf Node n  )  const [inline]
 

Definition at line 365 of file Graph.h.

Referenced by llvm::valueAssignmentToEdges().

bool llvm::Graph::isRoot Node n  )  const [inline]
 

Definition at line 361 of file Graph.h.

void llvm::Graph::makeUnDirectional  ) 
 

Definition at line 489 of file Graph.cpp.

References addEdgeForce(), DEBUG, getAllNodes(), getNodeList(), hasEdgeAndWt(), and llvm::printEdge().

Referenced by llvm::processGraph().

void llvm::Graph::printGraph  ) 
 

Definition at line 442 of file Graph.cpp.

References getAllNodes(), and getNodeList().

Referenced by getMaxSpanningTree().

void llvm::Graph::removeEdge Edge  ed  ) 
 

Definition at line 218 of file Graph.cpp.

References llvm::Edge::getFirst(), and llvm::Edge::getSecond().

Referenced by llvm::addDummyEdges(), llvm::processGraph(), and llvm::removeTreeEdges().

void llvm::Graph::removeEdgeWithWt Edge  ed  ) 
 

Definition at line 233 of file Graph.cpp.

References llvm::Edge::getFirst(), llvm::Edge::getSecond(), llvm::Edge::getWeight(), and llvm::Node::weight.

Referenced by llvm::moveDummyCode().

vector< Node * > llvm::Graph::reverseTopologicalSort  ) 
 

Definition at line 460 of file Graph.cpp.

References llvm::BLACK, getAllNodes(), and llvm::GREY.

Referenced by llvm::valueAssignmentToEdges().

void llvm::Graph::reverseWts  ) 
 

Definition at line 508 of file Graph.cpp.

References getAllNodes(), and getNodeList().

Referenced by llvm::processGraph().

void llvm::Graph::setWeight Edge  ed  ) 
 

Definition at line 246 of file Graph.cpp.

References llvm::findNodeInList(), llvm::Edge::getFirst(), llvm::Edge::getSecond(), llvm::Edge::getWeight(), and llvm::graphListElement::weight.

nodeList& llvm::Graph::sortNodeList Node par,
nodeList nl,
std::vector< Edge > &  be
 

Referenced by getSortedNodeList().


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