LLVM API Documentation

llvm::DSGraph Class Reference

#include <DSGraph.h>

Collaboration diagram for llvm::DSGraph:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MarkIncompleteFlags { MarkFormalArgs = 1, IgnoreFormalArgs = 0, IgnoreGlobals = 2, MarkGlobalsIncomplete = 0 }
enum  RemoveDeadNodesFlags { RemoveUnreachableGlobals = 1, KeepUnreachableGlobals = 0 }
enum  CloneFlags {
  StripAllocaBit = 1 << 0, KeepAllocaBit = 0, DontCloneCallNodes = 1 << 1, CloneCallNodes = 0,
  DontCloneAuxCallNodes = 1 << 2, CloneAuxCallNodes = 0, StripModRefBits = 1 << 3, KeepModRefBits = 0,
  StripIncompleteBit = 1 << 4, KeepIncompleteBit = 0
}
typedef DSScalarMap ScalarMapTy
typedef hash_map< Function *,
DSNodeHandle
ReturnNodesTy
typedef ilist< DSNodeNodeListTy
typedef hash_map< const DSNode *,
DSNodeHandle
NodeMapTy
typedef hash_multimap< DSNodeHandle,
const DSNode * > 
InvNodeMapTy
typedef NodeListTy::iterator node_iterator
typedef NodeListTy::const_iterator node_const_iterator
typedef std::list< DSCallSite
>::const_iterator 
fc_iterator
typedef std::list< DSCallSite
>::const_iterator 
afc_iterator
typedef ReturnNodesTy::const_iterator retnodes_iterator

Public Member Functions

 DSGraph (EquivalenceClasses< GlobalValue * > &ECs, const TargetData &td)
 DSGraph (EquivalenceClasses< GlobalValue * > &ECs, const TargetData &TD, Function &F, DSGraph *GlobalsGraph)
 DSGraph (const DSGraph &DSG, EquivalenceClasses< GlobalValue * > &ECs, unsigned CloneFlags=0)
 ~DSGraph ()
DSGraphgetGlobalsGraph () const
void setGlobalsGraph (DSGraph *G)
EquivalenceClasses< GlobalValue * > & getGlobalECs () const
const TargetDatagetTargetData () const
void setPrintAuxCalls ()
bool shouldPrintAuxCalls () const
node_iterator node_begin ()
node_iterator node_end ()
node_const_iterator node_begin () const
node_const_iterator node_end () const
std::string getFunctionNames () const
void addNode (DSNode *N)
void unlinkNode (DSNode *N)
ScalarMapTygetScalarMap ()
const ScalarMapTygetScalarMap () const
const std::list< DSCallSite > & getFunctionCalls () const
std::list< DSCallSite > & getFunctionCalls ()
std::list< DSCallSite > & getAuxFunctionCalls ()
const std::list< DSCallSite > & getAuxFunctionCalls () const
fc_iterator fc_begin () const
fc_iterator fc_end () const
afc_iterator afc_begin () const
afc_iterator afc_end () const
DSNodeHandlegetNodeForValue (Value *V)
const DSNodeHandlegetNodeForValue (Value *V) const
retnodes_iterator retnodes_begin () const
retnodes_iterator retnodes_end () const
const ReturnNodesTygetReturnNodes () const
ReturnNodesTygetReturnNodes ()
DSNodeHandlegetReturnNodeFor (Function &F)
const DSNodeHandlegetReturnNodeFor (Function &F) const
bool containsFunction (Function *F) const
unsigned getGraphSize () const
DSNodeaddObjectToGraph (Value *Ptr, bool UseDeclaredType=true)
void print (std::ostream &O) const
void dump () const
void viewGraph () const
void writeGraphToFile (std::ostream &O, const std::string &GraphName) const
void maskNodeTypes (unsigned Mask)
void maskIncompleteMarkers ()
void markIncompleteNodes (unsigned Flags)
void removeDeadNodes (unsigned Flags)
void updateFromGlobalGraph ()
void computeGToGGMapping (NodeMapTy &NodeMap)
void computeGGToGMapping (InvNodeMapTy &InvNodeMap)
void computeCalleeCallerMapping (DSCallSite CS, const Function &Callee, DSGraph &CalleeGraph, NodeMapTy &NodeMap)
void spliceFrom (DSGraph &RHS)
void cloneInto (const DSGraph &G, unsigned CloneFlags=0)
void getFunctionArgumentsForCall (Function *F, std::vector< DSNodeHandle > &Args) const
void mergeInGraph (const DSCallSite &CS, std::vector< DSNodeHandle > &Args, const DSGraph &G2, unsigned CloneFlags)
void mergeInGraph (const DSCallSite &CS, Function &F, const DSGraph &Graph, unsigned CloneFlags)
DSCallSite getCallSiteForArguments (Function &F) const
DSCallSite getDSCallSiteForCallSite (CallSite CS) const
void AssertNodeInGraph (const DSNode *N) const
void AssertNodeContainsGlobal (const DSNode *N, GlobalValue *GV) const
void AssertCallSiteInGraph (const DSCallSite &CS) const
void AssertCallNodesInGraph () const
void AssertAuxCallNodesInGraph () const
void AssertGraphOK () const
void removeTriviallyDeadNodes ()

Static Public Member Functions

static void computeNodeMapping (const DSNodeHandle &NH1, const DSNodeHandle &NH2, NodeMapTy &NodeMap, bool StrictChecking=true)

Detailed Description

DSGraph - The graph that represents a function.

Definition at line 176 of file DSGraph.h.


Member Typedef Documentation

typedef DSScalarMap llvm::DSGraph::ScalarMapTy

Definition at line 179 of file DSGraph.h.

typedef hash_map<Function*, DSNodeHandle> llvm::DSGraph::ReturnNodesTy

Definition at line 180 of file DSGraph.h.

typedef ilist<DSNode> llvm::DSGraph::NodeListTy

Definition at line 181 of file DSGraph.h.

typedef hash_map<const DSNode*, DSNodeHandle> llvm::DSGraph::NodeMapTy

NodeMapTy - This data type is used when cloning one graph into another to keep track of the correspondence between the nodes in the old and new graphs.

Definition at line 186 of file DSGraph.h.

typedef hash_multimap<DSNodeHandle, const DSNode*> llvm::DSGraph::InvNodeMapTy

Definition at line 190 of file DSGraph.h.

typedef NodeListTy::iterator llvm::DSGraph::node_iterator

node_iterator/begin/end - Iterate over all of the nodes in the graph. Be extremely careful with these methods because any merging of nodes could cause the node to be removed from this list. This means that if you are iterating over nodes and doing something that could cause _any_ node to merge, your node_iterators into this graph can be invalidated.

Definition at line 269 of file DSGraph.h.

typedef NodeListTy::const_iterator llvm::DSGraph::node_const_iterator

Definition at line 273 of file DSGraph.h.

typedef std::list<DSCallSite>::const_iterator llvm::DSGraph::fc_iterator

Definition at line 308 of file DSGraph.h.

typedef std::list<DSCallSite>::const_iterator llvm::DSGraph::afc_iterator

Definition at line 314 of file DSGraph.h.

typedef ReturnNodesTy::const_iterator llvm::DSGraph::retnodes_iterator

retnodes_* iterator methods: expose iteration over return nodes in the graph, which are also the set of functions incorporated in this graph.

Definition at line 332 of file DSGraph.h.


Member Enumeration Documentation

enum llvm::DSGraph::MarkIncompleteFlags

Enumerator:
MarkFormalArgs 
IgnoreFormalArgs 
IgnoreGlobals 
MarkGlobalsIncomplete 

Definition at line 412 of file DSGraph.h.

enum llvm::DSGraph::RemoveDeadNodesFlags

Enumerator:
RemoveUnreachableGlobals 
KeepUnreachableGlobals 

Definition at line 423 of file DSGraph.h.

enum llvm::DSGraph::CloneFlags

CloneFlags enum - Bits that may be passed into the cloneInto method to specify how to clone the function graph.

Enumerator:
StripAllocaBit 
KeepAllocaBit 
DontCloneCallNodes 
CloneCallNodes 
DontCloneAuxCallNodes 
CloneAuxCallNodes 
StripModRefBits 
KeepModRefBits 
StripIncompleteBit 
KeepIncompleteBit 

Definition at line 430 of file DSGraph.h.


Constructor & Destructor Documentation

llvm::DSGraph::DSGraph ( EquivalenceClasses< GlobalValue * > &  ECs,
const TargetData td 
) [inline]

Definition at line 226 of file DSGraph.h.

DSGraph::DSGraph ( EquivalenceClasses< GlobalValue * > &  ECs,
const TargetData TD,
Function F,
DSGraph GlobalsGraph 
)

Definition at line 180 of file Analysis/DataStructure/Local.cpp.

References llvm::Timer::addPeakMemoryMeasurement(), B, DEBUG, F, FunctionCalls, llvm::DSScalarMap::global_begin(), llvm::DSScalarMap::global_end(), GV, llvm::GlobalValue::isExternal(), KeepUnreachableGlobals, MarkFormalArgs, markIncompleteNodes(), llvm::ReachabilityCloner::merge(), RC, removeDeadNodes(), ReturnNodes, ScalarMap, and ScalarMap.

DSGraph::DSGraph ( const DSGraph DSG,
EquivalenceClasses< GlobalValue * > &  ECs,
unsigned  CloneFlags = 0 
)

Definition at line 1231 of file DataStructure.cpp.

References cloneInto(), and G.

DSGraph::~DSGraph (  ) 

Definition at line 1238 of file DataStructure.cpp.

References llvm::DSScalarMap::clear(), E, NI, node_begin(), and node_end().


Member Function Documentation

DSGraph* llvm::DSGraph::getGlobalsGraph (  )  const [inline]

Definition at line 245 of file DSGraph.h.

Referenced by computeGToGGMapping(), llvm::EquivClassGraphs::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule().

void llvm::DSGraph::setGlobalsGraph ( DSGraph G  )  [inline]

Definition at line 246 of file DSGraph.h.

References G.

EquivalenceClasses<GlobalValue*>& llvm::DSGraph::getGlobalECs (  )  const [inline]

getGlobalECs - Return the set of equivalence classes that the global variables in the program form.

Definition at line 250 of file DSGraph.h.

References llvm::DSScalarMap::getGlobalECs().

Referenced by llvm::DSNode::addFullFunctionList(), llvm::DSNode::addFullGlobalsList(), and getCaption().

const TargetData& llvm::DSGraph::getTargetData (  )  const [inline]

getTargetData - Return the TargetData object for the current target.

Definition at line 256 of file DSGraph.h.

Referenced by llvm::BUDataStructures::CreateGraphForExternalFunction(), and llvm::DSNode::getTargetData().

void llvm::DSGraph::setPrintAuxCalls (  )  [inline]

setPrintAuxCalls - If you call this method, the auxillary call vector will be printed instead of the standard call vector to the dot file.

Definition at line 261 of file DSGraph.h.

Referenced by llvm::TDDataStructures::runOnModule(), llvm::EquivClassGraphs::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule().

bool llvm::DSGraph::shouldPrintAuxCalls (  )  const [inline]

Definition at line 262 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), markIncompleteNodes(), and writeGraphToFile().

node_iterator llvm::DSGraph::node_begin (  )  [inline]

Definition at line 270 of file DSGraph.h.

Referenced by AssertGraphOK(), BuildGlobalECs(), cloneInto(), maskNodeTypes(), llvm::GraphTraits< const DSGraph * >::nodes_begin(), llvm::GraphTraits< DSGraph * >::nodes_begin(), removeTriviallyDeadNodes(), and ~DSGraph().

node_iterator llvm::DSGraph::node_end (  )  [inline]

Definition at line 271 of file DSGraph.h.

Referenced by AssertGraphOK(), BuildGlobalECs(), cloneInto(), maskNodeTypes(), llvm::GraphTraits< const DSGraph * >::nodes_end(), llvm::GraphTraits< DSGraph * >::nodes_end(), removeTriviallyDeadNodes(), and ~DSGraph().

node_const_iterator llvm::DSGraph::node_begin (  )  const [inline]

Definition at line 274 of file DSGraph.h.

node_const_iterator llvm::DSGraph::node_end (  )  const [inline]

Definition at line 275 of file DSGraph.h.

std::string DSGraph::getFunctionNames (  )  const

getFunctionNames - Return a space separated list of the name of the functions in this graph (if any)

Definition at line 1216 of file DataStructure.cpp.

References getReturnNodes(), retnodes_begin(), retnodes_end(), and size.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::getGraphName().

void llvm::DSGraph::addNode ( DSNode N  )  [inline]

addNode - Add a new node to the graph.

Definition at line 284 of file DSGraph.h.

Referenced by llvm::DSNode::DSNode().

void llvm::DSGraph::unlinkNode ( DSNode N  )  [inline]

Definition at line 285 of file DSGraph.h.

Referenced by llvm::DSNode::forwardNode().

ScalarMapTy& llvm::DSGraph::getScalarMap (  )  [inline]

getScalarMap - Get a map that describes what the nodes the scalars in this function point to...

Definition at line 290 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::DSNode::addGlobal(), llvm::DSNode::assertOK(), BuildGlobalECs(), computeCalleeCallerMapping(), computeGToGGMapping(), llvm::TDDataStructures::copyValue(), llvm::BUDataStructures::copyValue(), llvm::TDDataStructures::deleteValue(), llvm::BUDataStructures::deleteValue(), EliminateUsesOfECGlobals(), getCaption(), llvm::ReachabilityCloner::getClonedNH(), mergeInGraph(), removeDeadNodes(), llvm::TDDataStructures::runOnModule(), llvm::EquivClassGraphs::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), llvm::BUDataStructures::runOnModule(), and updateFromGlobalGraph().

const ScalarMapTy& llvm::DSGraph::getScalarMap (  )  const [inline]

Definition at line 291 of file DSGraph.h.

const std::list<DSCallSite>& llvm::DSGraph::getFunctionCalls (  )  const [inline]

getFunctionCalls - Return the list of call sites in the original local graph...

Definition at line 296 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), printCollection(), and writeGraphToFile().

std::list<DSCallSite>& llvm::DSGraph::getFunctionCalls (  )  [inline]

Definition at line 297 of file DSGraph.h.

std::list<DSCallSite>& llvm::DSGraph::getAuxFunctionCalls (  )  [inline]

getAuxFunctionCalls - Get the call sites as modified by whatever passes have been run.

Definition at line 302 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), and writeGraphToFile().

const std::list<DSCallSite>& llvm::DSGraph::getAuxFunctionCalls (  )  const [inline]

Definition at line 303 of file DSGraph.h.

fc_iterator llvm::DSGraph::fc_begin (  )  const [inline]

Definition at line 309 of file DSGraph.h.

Referenced by AssertCallNodesInGraph(), cloneInto(), and removeDeadNodes().

fc_iterator llvm::DSGraph::fc_end (  )  const [inline]

Definition at line 310 of file DSGraph.h.

Referenced by AssertCallNodesInGraph(), cloneInto(), and removeDeadNodes().

afc_iterator llvm::DSGraph::afc_begin (  )  const [inline]

Definition at line 315 of file DSGraph.h.

Referenced by AssertAuxCallNodesInGraph(), cloneInto(), GetAllAuxCallees(), mergeInGraph(), removeDeadNodes(), and llvm::TDDataStructures::runOnModule().

afc_iterator llvm::DSGraph::afc_end (  )  const [inline]

Definition at line 316 of file DSGraph.h.

Referenced by AssertAuxCallNodesInGraph(), cloneInto(), GetAllAuxCallees(), mergeInGraph(), removeDeadNodes(), and llvm::TDDataStructures::runOnModule().

DSNodeHandle& llvm::DSGraph::getNodeForValue ( Value V  )  [inline]

getNodeForValue - Given a value that is used or defined in the body of the current function, return the DSNode that it points to.

Definition at line 321 of file DSGraph.h.

References V.

Referenced by AssertGraphOK(), computeGToGGMapping(), getCallSiteForArguments(), llvm::ReachabilityCloner::getClonedNH(), getDSCallSiteForCallSite(), getFunctionArgumentsForCall(), llvm::EquivClassGraphs::getSomeCalleeForCallSite(), markIncompleteNodes(), llvm::ReachabilityCloner::merge(), mergeInGraph(), removeTriviallyDeadNodes(), llvm::EquivClassGraphs::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), llvm::BUDataStructures::runOnModule(), and updateFromGlobalGraph().

const DSNodeHandle& llvm::DSGraph::getNodeForValue ( Value V  )  const [inline]

Definition at line 323 of file DSGraph.h.

References llvm::DSScalarMap::end(), llvm::DSScalarMap::find(), and V.

retnodes_iterator llvm::DSGraph::retnodes_begin (  )  const [inline]

Definition at line 333 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), CheckAllGraphs(), cloneInto(), getCaption(), getFunctionNames(), and llvm::DSNode::mergeTypeInfo().

retnodes_iterator llvm::DSGraph::retnodes_end (  )  const [inline]

Definition at line 334 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), cloneInto(), getCaption(), getFunctionNames(), and llvm::DSNode::mergeTypeInfo().

const ReturnNodesTy& llvm::DSGraph::getReturnNodes (  )  const [inline]

getReturnNodes - Return the mapping of functions to their return nodes for this graph.

Definition at line 340 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::TDDataStructures::deleteValue(), llvm::BUDataStructures::deleteValue(), getFunctionNames(), and llvm::DOTGraphTraits< const DSGraph * >::getGraphName().

ReturnNodesTy& llvm::DSGraph::getReturnNodes (  )  [inline]

Definition at line 341 of file DSGraph.h.

DSNodeHandle& llvm::DSGraph::getReturnNodeFor ( Function F  )  [inline]

getReturnNodeFor - Return the return node for the specified function.

Definition at line 345 of file DSGraph.h.

References F.

Referenced by getCallSiteForArguments(), and getFunctionArgumentsForCall().

const DSNodeHandle& llvm::DSGraph::getReturnNodeFor ( Function F  )  const [inline]

Definition at line 351 of file DSGraph.h.

References F.

bool llvm::DSGraph::containsFunction ( Function F  )  const [inline]

containsFunction - Return true if this DSGraph contains information for the specified function.

Definition at line 359 of file DSGraph.h.

References F.

unsigned llvm::DSGraph::getGraphSize (  )  const [inline]

getGraphSize - Return the number of nodes in this graph.

Definition at line 365 of file DSGraph.h.

Referenced by printCollection(), and writeGraphToFile().

DSNode * DSGraph::addObjectToGraph ( Value Ptr,
bool  UseDeclaredType = true 
)

addObjectToGraph - This method can be used to add global, stack, and heap objects to the graph. This can be used when updating DSGraphs due to the introduction of new temporary objects. The new object is not pointed to and does not point to any other objects in the graph. Note that this method initializes the type of the DSNode to the declared type of the object if UseDeclaredType is true, otherwise it leaves the node type as void.

Definition at line 1274 of file DataStructure.cpp.

References llvm::DSNode::addGlobal(), AI, llvm::Value::getType(), MI, llvm::DSNode::setAllocaNodeMarker(), llvm::DSNode::setHeapNodeMarker(), and Ty.

void DSGraph::print ( std::ostream &  O  )  const

print - Print a dot graph to the specified ostream...

Definition at line 236 of file Printer.cpp.

References llvm::WriteGraph().

Referenced by dump(), and writeGraphToFile().

void DSGraph::dump (  )  const

dump - call print(std::cerr), for use from the debugger...

Definition at line 1253 of file DataStructure.cpp.

References print().

void DSGraph::viewGraph (  )  const

viewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, then cleanup. For use from the debugger.

Definition at line 259 of file Printer.cpp.

References llvm::ViewGraph().

void DSGraph::writeGraphToFile ( std::ostream &  O,
const std::string &  GraphName 
) const

Definition at line 240 of file Printer.cpp.

References F, Filename, getAuxFunctionCalls(), getFunctionCalls(), getGraphSize(), print(), and shouldPrintAuxCalls().

Referenced by printCollection().

void llvm::DSGraph::maskNodeTypes ( unsigned  Mask  )  [inline]

maskNodeTypes - Apply a mask to all of the node types in the graph. This is useful for clearing out markers like Incomplete.

Definition at line 397 of file DSGraph.h.

References E, node_begin(), and node_end().

Referenced by maskIncompleteMarkers().

void llvm::DSGraph::maskIncompleteMarkers (  )  [inline]

Definition at line 401 of file DSGraph.h.

References llvm::DSNode::Incomplete, and maskNodeTypes().

Referenced by llvm::BUDataStructures::runOnModule().

void DSGraph::markIncompleteNodes ( unsigned  Flags  ) 

Definition at line 1725 of file DataStructure.cpp.

References E, F, getNodeForValue(), llvm::DSScalarMap::global_begin(), llvm::DSScalarMap::global_end(), IgnoreGlobals, llvm::DS::isPointerType(), MarkFormalArgs, markIncomplete(), markIncompleteNode(), and shouldPrintAuxCalls().

Referenced by DSGraph(), llvm::EquivClassGraphs::runOnModule(), and llvm::BUDataStructures::runOnModule().

void DSGraph::removeDeadNodes ( unsigned  Flags  ) 

Definition at line 2094 of file DataStructure.cpp.

References afc_begin(), afc_end(), AssertGraphOK(), AuxFunctionCalls, llvm::DSScalarMap::begin(), CallSiteUsesAliveArgs(), CanReachAliveNodes(), DEBUG, llvm::ReachabilityCloner::destroy(), E, llvm::DSScalarMap::end(), llvm::DSScalarMap::erase(), fc_begin(), fc_end(), llvm::DSScalarMap::find(), llvm::ReachabilityCloner::getClonedNH(), llvm::DSNodeHandle::getNode(), getScalarMap(), llvm::DSNode::markReachableNodes(), llvm::ReachabilityCloner::merge(), NI, NumDNE, removeTriviallyDeadNodes(), RemoveUnreachableGlobals, StripAllocaBit, StripIncompleteBit, TIME_REGION, Visited, llvm::X, and Y.

Referenced by DSGraph().

void DSGraph::updateFromGlobalGraph (  ) 

updateFromGlobalGraph - This function rematerializes global nodes and nodes reachable from them from the globals graph into the current graph.

Definition at line 2414 of file DataStructure.cpp.

References E, llvm::DSScalarMap::end(), llvm::DSScalarMap::find(), getNodeForValue(), getScalarMap(), llvm::ReachabilityCloner::merge(), RC, ScalarMap, TIME_REGION, and llvm::X.

void DSGraph::computeNodeMapping ( const DSNodeHandle NH1,
const DSNodeHandle NH2,
NodeMapTy NodeMap,
bool  StrictChecking = true 
) [static]

computeNodeMapping - Given roots in two different DSGraphs, traverse the nodes reachable from the two graphs, computing the mapping of nodes from the first to the second graph.

Definition at line 2308 of file DataStructure.cpp.

References llvm::DSNode::getLink(), llvm::DSNodeHandle::getNode(), llvm::DSNodeHandle::getOffset(), llvm::DSNode::getSize(), llvm::DSNode::isNodeCompletelyFolded(), llvm::DSNodeHandle::isNull(), llvm::DS::PointerSize, and llvm::DSNodeHandle::setTo().

Referenced by computeCalleeCallerMapping(), and computeGToGGMapping().

void DSGraph::computeGToGGMapping ( NodeMapTy NodeMap  ) 

computeGToGGMapping - Compute the mapping of nodes in the graph to nodes in the globals graph.

Definition at line 2351 of file DataStructure.cpp.

References computeNodeMapping(), E, getGlobalsGraph(), getNodeForValue(), getScalarMap(), llvm::DSScalarMap::global_begin(), and llvm::DSScalarMap::global_end().

Referenced by CheckAllGraphs(), and computeGGToGMapping().

void DSGraph::computeGGToGMapping ( InvNodeMapTy InvNodeMap  ) 

computeGGToGMapping - Compute the mapping of nodes in the global graph to nodes in this graph.

Definition at line 2363 of file DataStructure.cpp.

References computeGToGGMapping().

void DSGraph::computeCalleeCallerMapping ( DSCallSite  CS,
const Function Callee,
DSGraph CalleeGraph,
NodeMapTy NodeMap 
)

computeCalleeCallerMapping - Given a call from a function in the current graph to the 'Callee' function (which lives in 'CalleeGraph'), compute the mapping of nodes from the callee to nodes in the caller.

Definition at line 2378 of file DataStructure.cpp.

References computeNodeMapping(), E, getCallSiteForArguments(), llvm::DSCallSite::getNumPtrArgs(), llvm::DSCallSite::getPtrArg(), llvm::DSCallSite::getRetVal(), getScalarMap(), GI, llvm::DSScalarMap::global_begin(), llvm::DSScalarMap::global_count(), llvm::DSScalarMap::global_end(), and llvm::DSScalarMap::global_size().

void DSGraph::spliceFrom ( DSGraph RHS  ) 

spliceFrom - Logically perform the operation of cloning the RHS graph into this graph, then clearing the RHS graph. Instead of performing this as two seperate operations, do it as a single, much faster, one.

Definition at line 1374 of file DataStructure.cpp.

References AuxFunctionCalls, E, FunctionCalls, Nodes, ReturnNodes, ScalarMap, and llvm::DSScalarMap::spliceFrom().

void DSGraph::cloneInto ( const DSGraph G,
unsigned  CloneFlags = 0 
)

cloneInto - Clone the specified DSGraph into the current graph.

The CloneFlags member controls various aspects of the cloning process.

Definition at line 1301 of file DataStructure.cpp.

References llvm::Timer::addPeakMemoryMeasurement(), afc_begin(), afc_end(), llvm::DSNode::AllocaNode, llvm::DSScalarMap::begin(), llvm::DSNode::DEAD, DontCloneAuxCallNodes, DontCloneCallNodes, E, llvm::DSScalarMap::end(), fc_begin(), fc_end(), G, llvm::DSNodeHandle::getNode(), llvm::DSScalarMap::getRawEntryRef(), H, llvm::DSNode::Incomplete, llvm::DSNode::maskNodeTypes(), llvm::DSNode::Modified, node_begin(), node_end(), llvm::DSNode::Read, retnodes_begin(), retnodes_end(), ScalarMap, StripAllocaBit, StripIncompleteBit, StripModRefBits, TIME_REGION, and llvm::X.

Referenced by DSGraph().

void DSGraph::getFunctionArgumentsForCall ( Function F,
std::vector< DSNodeHandle > &  Args 
) const

getFunctionArgumentsForCall - Given a function that is currently in this graph, return the DSNodeHandles that correspond to the pointer-compatible function arguments. The vector is filled in with the return value (or null if it is not pointer compatible), followed by all of the pointer-compatible arguments.

Definition at line 1420 of file DataStructure.cpp.

References AI, E, F, getNodeForValue(), getReturnNodeFor(), llvm::AllocationInst::getType(), and llvm::DS::isPointerType().

Referenced by mergeInGraph().

void DSGraph::mergeInGraph ( const DSCallSite CS,
std::vector< DSNodeHandle > &  Args,
const DSGraph G2,
unsigned  CloneFlags 
)

mergeInGraph - This graph merges in the minimal number of nodes from G2 into 'this' graph, merging the bindings specified by the call site (in this graph) with the bindings specified by the vector in G2. If the StripAlloca's argument is 'StripAllocaBit' then Alloca markers are removed from nodes.

Definition at line 1541 of file DataStructure.cpp.

References afc_begin(), afc_end(), DontCloneAuxCallNodes, DontCloneCallNodes, E, llvm::ReachabilityCloner::getClonedNH(), llvm::DSNodeHandle::getNode(), getNodeForValue(), llvm::DSCallSite::getNumPtrArgs(), llvm::DSCallSite::getPtrArg(), llvm::DSCallSite::getRetVal(), getScalarMap(), GI, llvm::DSScalarMap::global_begin(), llvm::DSScalarMap::global_end(), llvm::DSNodeHandle::isNull(), llvm::ReachabilityCloner::merge(), RC, TIME_REGION, and llvm::X.

Referenced by mergeInGraph().

void DSGraph::mergeInGraph ( const DSCallSite CS,
Function F,
const DSGraph Graph,
unsigned  CloneFlags 
)

mergeInGraph - This method is the same as the above method, but the argument bindings are provided by using the formal arguments of F.

Definition at line 1636 of file DataStructure.cpp.

References F, getFunctionArgumentsForCall(), and mergeInGraph().

DSCallSite DSGraph::getCallSiteForArguments ( Function F  )  const

getCallSiteForArguments - Get the arguments and return value bindings for the specified function in the current graph.

Definition at line 1648 of file DataStructure.cpp.

References E, F, getNodeForValue(), getReturnNodeFor(), and llvm::DS::isPointerType().

Referenced by computeCalleeCallerMapping().

DSCallSite DSGraph::getDSCallSiteForCallSite ( CallSite  CS  )  const

getDSCallSiteForCallSite - Given an LLVM CallSite object that is live in the context of this graph, return the DSCallSite for it.

Definition at line 1660 of file DataStructure.cpp.

References llvm::CallSite::arg_begin(), llvm::CallSite::arg_end(), E, F, llvm::CallSite::getCalledFunction(), llvm::CallSite::getInstruction(), getNodeForValue(), llvm::Value::getType(), and llvm::DS::isPointerType().

void llvm::DSGraph::AssertNodeInGraph ( const DSNode N  )  const [inline]

Definition at line 507 of file DSGraph.h.

References llvm::DSNode::getParentGraph().

Referenced by AssertCallSiteInGraph(), and AssertGraphOK().

void DSGraph::AssertNodeContainsGlobal ( const DSNode N,
GlobalValue GV 
) const

Definition at line 2244 of file DataStructure.cpp.

References llvm::DSNode::globals_begin(), llvm::DSNode::globals_end(), and GV.

Referenced by AssertGraphOK().

void DSGraph::AssertCallSiteInGraph ( const DSCallSite CS  )  const

Definition at line 2249 of file DataStructure.cpp.

References AssertNodeInGraph(), llvm::DSCallSite::getCalleeNode(), llvm::DSNodeHandle::getNode(), llvm::DSCallSite::getNumPtrArgs(), llvm::DSCallSite::getPtrArg(), llvm::DSCallSite::getRetVal(), and llvm::DSCallSite::isIndirectCall().

Referenced by AssertAuxCallNodesInGraph(), and AssertCallNodesInGraph().

void DSGraph::AssertCallNodesInGraph (  )  const

Definition at line 2263 of file DataStructure.cpp.

References AssertCallSiteInGraph(), E, fc_begin(), and fc_end().

Referenced by AssertGraphOK().

void DSGraph::AssertAuxCallNodesInGraph (  )  const

Definition at line 2267 of file DataStructure.cpp.

References afc_begin(), afc_end(), AssertCallSiteInGraph(), and E.

Referenced by AssertGraphOK().

void DSGraph::AssertGraphOK (  )  const

Definition at line 2272 of file DataStructure.cpp.

References AI, AssertAuxCallNodesInGraph(), AssertCallNodesInGraph(), AssertNodeContainsGlobal(), AssertNodeInGraph(), llvm::DSScalarMap::begin(), E, llvm::DSScalarMap::end(), F, getNodeForValue(), llvm::AllocationInst::getType(), llvm::DS::isPointerType(), NI, node_begin(), and node_end().

Referenced by BuildGlobalECs(), EliminateUsesOfECGlobals(), and removeDeadNodes().

void DSGraph::removeTriviallyDeadNodes (  ) 

removeTriviallyDeadNodes - After the graph has been constructed, this method removes all unreachable nodes that are created because they got merged with other nodes in the graph. This is used as the first step of removeDeadNodes.

Definition at line 1931 of file DataStructure.cpp.

References llvm::DSScalarMap::begin(), E, llvm::DSScalarMap::end(), llvm::DSScalarMap::erase(), llvm::DSNodeHandle::getNode(), getNodeForValue(), NI, Node, node_begin(), node_end(), NumTrivialDNE, NumTrivialGlobalDNE, removeIdenticalCalls(), TIME_REGION, and llvm::X.

Referenced by removeDeadNodes(), llvm::TDDataStructures::runOnModule(), llvm::EquivClassGraphs::runOnModule(), llvm::CompleteBUDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule().


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