LLVM API Documentation
#include <DSNode.h>
Collaboration diagram for llvm::DSNode:
Public Types | |
typedef DSNodeIterator< DSNode > | iterator |
typedef DSNodeIterator< const DSNode > | const_iterator |
typedef std::vector< GlobalValue * >::const_iterator | global_iterator |
enum | NodeTy { ShadowNode = 0, AllocaNode = 1 << 0, HeapNode = 1 << 1, GlobalNode = 1 << 2, UnknownNode = 1 << 3, Incomplete = 1 << 4, Modified = 1 << 5, Read = 1 << 6, Array = 1 << 7, DEAD = 1 << 8, Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode } |
Public Member Functions | |
DSNode (const Type *T, DSGraph *G) | |
DSNode (const DSNode &, DSGraph *G, bool NullLinks=false) | |
~DSNode () | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
unsigned | getSize () const |
const Type * | getType () const |
bool | isArray () const |
bool | hasNoReferrers () const |
unsigned | getNumReferrers () const |
DSGraph * | getParentGraph () const |
void | setParentGraph (DSGraph *G) |
const TargetData & | getTargetData () const |
DSNode * | getForwardNode () const |
bool | isForwarding () const |
void | stopForwarding () |
bool | hasLink (unsigned Offset) const |
DSNodeHandle & | getLink (unsigned Offset) |
const DSNodeHandle & | getLink (unsigned Offset) const |
unsigned | getNumLinks () const |
bool | mergeTypeInfo (const Type *Ty, unsigned Offset, bool FoldIfIncompatible=true) |
void | foldNodeCompletely () |
bool | isNodeCompletelyFolded () const |
void | setLink (unsigned Offset, const DSNodeHandle &NH) |
unsigned | getPointerSize () const |
void | addEdgeTo (unsigned Offset, const DSNodeHandle &NH) |
void | mergeWith (const DSNodeHandle &NH, unsigned Offset) |
void | addGlobal (GlobalValue *GV) |
void | mergeGlobals (const std::vector< GlobalValue * > &RHS) |
const std::vector< GlobalValue * > & | getGlobals () const |
global_iterator | global_begin () const |
global_iterator | global_end () const |
void | maskNodeTypes (unsigned Mask) |
void | mergeNodeFlags (unsigned RHS) |
unsigned | getNodeFlags () const |
bool | isAllocaNode () const |
bool | isHeapNode () const |
bool | isGlobalNode () const |
bool | isUnknownNode () const |
bool | isModified () const |
bool | isRead () const |
bool | isIncomplete () const |
bool | isComplete () const |
bool | isDeadNode () const |
DSNode * | setAllocaNodeMarker () |
DSNode * | setHeapNodeMarker () |
DSNode * | setGlobalNodeMarker () |
DSNode * | setUnknownNodeMarker () |
DSNode * | setIncompleteMarker () |
DSNode * | setModifiedMarker () |
DSNode * | setReadMarker () |
DSNode * | setArrayMarker () |
void | makeNodeDead () |
void | forwardNode (DSNode *To, unsigned Offset) |
void | print (std::ostream &O, const DSGraph *G) const |
void | dump () const |
void | assertOK () const |
void | dropAllReferences () |
void | remapLinks (hash_map< const DSNode *, DSNodeHandle > &OldNodeMap) |
void | markReachableNodes (hash_set< DSNode * > &ReachableNodes) |
Friends | |
struct | ilist_traits< DSNode > |
class | DSNodeHandle |
This class represents an untyped memory object of Size bytes. It keeps track of any pointers that have been stored into the object as well as the different types represented in this object.
Definition at line 32 of file DSNode.h.
|
|
|
|
|
|
|
|
|
DSNode ctor - Create a node of the specified type, inserting it into the specified graph. Definition at line 79 of file DataStructure.cpp. References llvm::DSGraph::addNode(), mergeTypeInfo(), and NumNodeAllocated. |
|
DSNode "copy ctor" - Copy the specified node, inserting it into the specified graph. If NullLinks is true, then null out all of the links, but keep the same number of them. This can be used for efficiency if the links are just going to be clobbered anyway. Definition at line 88 of file DataStructure.cpp. References llvm::DSGraph::addNode(), Globals, Links, and NumNodeAllocated. |
|
Definition at line 120 of file DSNode.h. References dropAllReferences(), and hasNoReferrers(). |
|
addEdgeTo - Add an edge from the current node to the specified node. This can cause merging of nodes in the graph. Definition at line 567 of file DataStructure.cpp. References getLink(), llvm::DSNodeHandle::isNull(), llvm::DSNodeHandle::mergeWith(), and setLink(). Referenced by llvm::DSNodeHandle::addEdgeTo(), and llvm::ReachabilityCloner::getClonedNH(). |
|
addGlobal - Add an entry for a global value to the Globals list. This also marks the node with the 'G' flag if it does not already have it. Definition at line 142 of file DataStructure.cpp. References GlobalNode, and I. |
|
Definition at line 106 of file DataStructure.cpp. References Array, llvm::DSScalarMap::count(), llvm::DSScalarMap::find(), llvm::DSNodeIterator< NodeTy >::getNode(), llvm::DSGraph::getScalarMap(), and llvm::Type::VoidTy. |
|
Definition at line 87 of file DSGraphTraits.h. |
|
|
Definition at line 336 of file DSNode.h. References isForwarding(), and llvm::DSNodeHandle::setTo(). Referenced by ~DSNode(). |
|
Definition at line 37 of file Printer.cpp. References print(). |
|
Definition at line 90 of file DSGraphTraits.h. |
|
Definition at line 84 of file DSGraphTraits.h. Referenced by llvm::GraphTraits< const DSGraph * >::child_end(), llvm::GraphTraits< DSGraph * >::child_end(), llvm::GraphTraits< const DSNode * >::child_end(), and llvm::GraphTraits< DSNode * >::child_end(). |
|
foldNodeCompletely - If we determine that this node has some funny behavior happening to it that we cannot represent, we fold it down to a single, completely pessimistic, node. This node is represented as a single byte with a single TypeEntry of "void" with isArray = true. Definition at line 159 of file DataStructure.cpp. References Array, forwardNode(), llvm::DSNodeHandle::getNode(), getSize(), Globals, isNodeCompletelyFolded(), Links, NodeType, NumFolds, Size, Ty, and llvm::Type::VoidTy. Referenced by llvm::ReachabilityCloner::merge(), mergeTypeInfo(), and mergeWith(). |
|
forwardNode - Mark this node as being obsolete, and all references to it should be forwarded to the specified node and offset. Definition at line 123 of file DataStructure.cpp. References DEAD, llvm::DSNodeHandle::isNull(), llvm::DSNodeHandle::setTo(), Size, llvm::DSGraph::unlinkNode(), and llvm::Type::VoidTy. Referenced by foldNodeCompletely(). |
|
getForwardNode - This method returns the node that this node is forwarded to, if any. Definition at line 166 of file DSNode.h. References llvm::DSNodeHandle::getNode(). Referenced by CanReachAliveNodes(), and markReachableNodes(). |
|
|
Definition at line 203 of file DSNode.h. References llvm::DS::PointerShift. |
|
getLink - Return the link at the specified offset. Definition at line 196 of file DSNode.h. References llvm::DS::PointerShift. Referenced by addEdgeTo(), CanReachAliveNodes(), llvm::DSGraph::computeNodeMapping(), llvm::DOTGraphTraits< const DSGraph * >::edgeTargetsEdgeSource(), llvm::ReachabilityCloner::getClonedNH(), llvm::DOTGraphTraits< const DSGraph * >::getEdgeTarget(), llvm::DSNodeHandle::getLink(), markIncompleteNode(), markReachableNodes(), llvm::ReachabilityCloner::merge(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
getNodeFlags - Return all of the flags set on the node. If the DEAD flag is set, hide it from the caller. Definition at line 296 of file DSNode.h. References DEAD. Referenced by getCaption(), killIfUselessEdge(), llvm::ReachabilityCloner::merge(), llvm::DSGraph::removeDeadNodes(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
getNumLinks - Return the number of links in a node... Definition at line 213 of file DSNode.h. Referenced by llvm::ReachabilityCloner::getClonedNH(), llvm::ReachabilityCloner::merge(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
getNumReferrers - This method returns the number of referrers to the current node. Note that if this node is a forwarding node, this will return the number of nodes forwarding over the node! Definition at line 153 of file DSNode.h. Referenced by hasNoReferrers(), killIfUselessEdge(), removeIdenticalCalls(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
Definition at line 155 of file DSNode.h. Referenced by llvm::DSGraph::AssertNodeInGraph(), getCaption(), and mergeTypeInfo(). |
|
getPointerSize - Return the size of a pointer for the current target. Definition at line 255 of file DSNode.h. References llvm::DS::PointerSize. Referenced by llvm::DSGraph::removeTriviallyDeadNodes(). |
|
getSize - Return the maximum number of bytes occupied by this object... Definition at line 138 of file DSNode.h. Referenced by CanReachAliveNodes(), llvm::DSGraph::computeNodeMapping(), foldNodeCompletely(), llvm::ReachabilityCloner::getClonedNH(), isNodeCompletelyFolded(), markIncompleteNode(), markReachableNodes(), llvm::ReachabilityCloner::merge(), and mergeWith(). |
|
getTargetData - Get the target data object used to construct this node. Definition at line 102 of file DataStructure.cpp. References llvm::DSGraph::getTargetData(). Referenced by mergeTypeInfo(). |
|
getType - Return the node type of this object... Definition at line 142 of file DSNode.h. Referenced by getCaption(), killIfUselessEdge(), and llvm::ReachabilityCloner::merge(). |
|
Definition at line 279 of file DSNode.h. Referenced by llvm::ReachabilityCloner::getClonedNH(), and llvm::ReachabilityCloner::merge(). |
|
Definition at line 280 of file DSNode.h. Referenced by llvm::ReachabilityCloner::getClonedNH(), and llvm::ReachabilityCloner::merge(). |
|
hasLink - Return true if this memory object has a link in slot LinkNo Definition at line 186 of file DSNode.h. References llvm::DS::PointerShift. Referenced by llvm::DSNodeHandle::hasLink(). |
|
hasNoReferrers - Return true if nothing is pointing to this node at all. Definition at line 148 of file DSNode.h. References getNumReferrers(). Referenced by makeNodeDead(), mergeWith(), llvm::DSGraph::removeTriviallyDeadNodes(), and ~DSNode(). |
|
Definition at line 298 of file DSNode.h. References AllocaNode. Referenced by isSinglePhysicalObject(). |
|
Definition at line 144 of file DSNode.h. References Array. Referenced by getCaption(), isNodeCompletelyFolded(), llvm::ReachabilityCloner::merge(), and mergeTypeInfo(). |
|
Definition at line 307 of file DSNode.h. References isIncomplete(). Referenced by isSinglePhysicalObject(), removeIdenticalCalls(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
Definition at line 308 of file DSNode.h. References DEAD. Referenced by llvm::ReachabilityCloner::merge(), and mergeWith(). |
|
isForwarding - Return true if this node is forwarding to another. Definition at line 170 of file DSNode.h. References llvm::DSNodeHandle::isNull(). Referenced by dropAllReferences(), llvm::DSNodeHandle::getNode(), llvm::DSGraph::removeDeadNodes(), llvm::DSNodeHandle::setTo(), and stopForwarding(). |
|
Definition at line 300 of file DSNode.h. References GlobalNode. Referenced by CanReachAliveNodes(), isSinglePhysicalObject(), and llvm::DSGraph::removeTriviallyDeadNodes(). |
|
Definition at line 299 of file DSNode.h. References HeapNode. Referenced by isSinglePhysicalObject(). |
|
Definition at line 306 of file DSNode.h. References Incomplete. Referenced by isComplete(), llvm::DSCallSiteIterator::isCompleteNode(), and markIncompleteNode(). |
|
Definition at line 303 of file DSNode.h. References Modified. Referenced by llvm::DSGraph::removeTriviallyDeadNodes(). |
|
isNodeCompletelyFolded - Return true if this node has been completely folded down to something that can never be expanded, effectively losing all of the field sensitivity that may be present in the node. Definition at line 205 of file DataStructure.cpp. References getSize(), isArray(), and llvm::Type::VoidTy. Referenced by llvm::DSGraph::computeNodeMapping(), foldNodeCompletely(), getCaption(), llvm::DSNodeHandle::getNode(), killIfUselessEdge(), llvm::ReachabilityCloner::merge(), and mergeTypeInfo(). |
|
Definition at line 304 of file DSNode.h. References Read. Referenced by llvm::DSGraph::removeTriviallyDeadNodes(). |
|
Definition at line 301 of file DSNode.h. References UnknownNode. Referenced by isSinglePhysicalObject(). |
|
Definition at line 320 of file DSNode.h. References DEAD, and hasNoReferrers(). Referenced by llvm::DSGraph::removeTriviallyDeadNodes(). |
|
markReachableNodes - This method recursively traverses the specified DSNodes, marking any nodes which are reachable. All reachable nodes it adds to the set, which allows it to only traverse visited nodes once. Definition at line 1693 of file DataStructure.cpp. References getForwardNode(), getLink(), llvm::DSNodeHandle::getNode(), getSize(), markReachableNodes(), and llvm::DS::PointerSize. Referenced by CanReachAliveNodes(), llvm::DSCallSite::markReachableNodes(), markReachableNodes(), and llvm::DSGraph::removeDeadNodes(). |
|
maskNodeTypes - Apply a mask to the node types bitfield. Definition at line 285 of file DSNode.h. Referenced by llvm::DSGraph::cloneInto(), llvm::ReachabilityCloner::getClonedNH(), and llvm::ReachabilityCloner::merge(). |
|
Definition at line 623 of file DataStructure.cpp. References MergeSortedVectors(). Referenced by llvm::ReachabilityCloner::getClonedNH(), and llvm::ReachabilityCloner::merge(). |
|
Definition at line 289 of file DSNode.h. Referenced by llvm::ReachabilityCloner::merge(). |
|
mergeTypeInfo - This method merges the specified type into the current node at the specified offset. This may update the current node's type record if this gives more information to the node, it may do nothing to the node if this information is already known, or it may merge the node completely (and return true) if the information is incompatible with what is already known. This method returns true if the node is completely folded, otherwise false. Definition at line 335 of file DataStructure.cpp. References Array, llvm::Type::ArrayTyID, DEBUG, ElementTypesAreCompatible(), foldNodeCompletely(), llvm::StructType::getElementType(), llvm::SequentialType::getElementType(), getParentGraph(), llvm::DSGraph::getReturnNodes(), llvm::TargetData::getStructLayout(), getTargetData(), llvm::Type::getTypeID(), llvm::TargetData::getTypeSize(), isArray(), isNodeCompletelyFolded(), llvm::Type::isSized(), M, llvm::StructLayout::MemberOffsets, llvm::DS::PointerShift, llvm::DS::PointerSize, llvm::Type::StructTyID, llvm::Type::VoidTy, and llvm::WriteTypeSymbolic(). Referenced by DSNode(), and llvm::ReachabilityCloner::merge(). |
|
mergeWith - Merge this node and the specified node, moving all links to and from the argument node into the current node, deleting the node argument. Offset indicates what offset the specified node is to be merged into the current node. The specified node may be a null pointer (in which case, nothing happens). Definition at line 739 of file DataStructure.cpp. References DEBUG, DSNodeHandle, foldNodeCompletely(), llvm::DSNodeHandle::getNode(), llvm::DSNodeHandle::getOffset(), getSize(), hasNoReferrers(), isDeadNode(), mergeWith(), and llvm::DSNodeHandle::mergeWith(). Referenced by llvm::DSNodeHandle::mergeWith(), and mergeWith(). |
|
Definition at line 216 of file Printer.cpp. References llvm::GraphWriter< GraphType >::writeNode(). Referenced by dump(). |
|
remapLinks - Change all of the Links in the current node according to the specified mapping. |
|
Definition at line 310 of file DSNode.h. References AllocaNode. |
|
Definition at line 318 of file DSNode.h. References Array. |
|
Definition at line 312 of file DSNode.h. References GlobalNode. |
|
Definition at line 311 of file DSNode.h. References HeapNode. |
|
Definition at line 315 of file DSNode.h. References Incomplete. Referenced by markIncompleteNode(). |
|
setLink - Set the link at the specified offset to the specified NodeHandle, replacing what was there. It is uncommon to use this method, instead one of the higher level methods should be used, below. Definition at line 245 of file DSNode.h. References llvm::DS::PointerShift. Referenced by addEdgeTo(), and llvm::DSNodeHandle::setLink(). |
|
Definition at line 316 of file DSNode.h. References Modified. |
|
|
|
Definition at line 317 of file DSNode.h. References Read. |
|
Definition at line 313 of file DSNode.h. References UnknownNode. |
|
stopForwarding - When the last reference to this forwarding node has been dropped, delete the node. Definition at line 175 of file DSNode.h. References isForwarding(), and llvm::DSNodeHandle::setTo(). |
|
Definition at line 354 of file DSNode.h. Referenced by mergeWith(). |
|
|