+
+ typedef std::vector<GlobalValue*>::const_iterator global_iterator;
+ global_iterator global_begin() const { return Globals.begin(); }
+ global_iterator global_end() const { return Globals.end(); }
+
+
+ /// maskNodeTypes - Apply a mask to the node types bitfield.
+ ///
+ void maskNodeTypes(unsigned Mask) {
+ NodeType &= Mask;
+ }
+
+ void mergeNodeFlags(unsigned RHS) {
+ NodeType |= RHS;
+ }
+
+ /// getNodeFlags - Return all of the flags set on the node. If the DEAD flag
+ /// is set, hide it from the caller.
+ unsigned getNodeFlags() const { return NodeType & ~DEAD; }
+
+ bool isAllocaNode() const { return NodeType & AllocaNode; }
+ bool isHeapNode() const { return NodeType & HeapNode; }
+ bool isGlobalNode() const { return NodeType & GlobalNode; }
+ bool isUnknownNode() const { return NodeType & UnknownNode; }
+
+ bool isModified() const { return NodeType & Modified; }
+ bool isRead() const { return NodeType & Read; }
+
+ bool isIncomplete() const { return NodeType & Incomplete; }
+ bool isComplete() const { return !isIncomplete(); }
+ bool isDeadNode() const { return NodeType & DEAD; }
+
+ DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; return this; }
+ DSNode *setHeapNodeMarker() { NodeType |= HeapNode; return this; }
+ DSNode *setGlobalNodeMarker() { NodeType |= GlobalNode; return this; }
+ DSNode *setUnknownNodeMarker() { NodeType |= UnknownNode; return this; }
+
+ DSNode *setIncompleteMarker() { NodeType |= Incomplete; return this; }
+ DSNode *setModifiedMarker() { NodeType |= Modified; return this; }
+ DSNode *setReadMarker() { NodeType |= Read; return this; }
+ DSNode *setArrayMarker() { NodeType |= Array; return this; }
+
+ void makeNodeDead() {
+ Globals.clear();
+ assert(hasNoReferrers() && "Dead node shouldn't have refs!");
+ NodeType = DEAD;
+ }
+
+ /// forwardNode - Mark this node as being obsolete, and all references to it
+ /// should be forwarded to the specified node and offset.
+ ///
+ void forwardNode(DSNode *To, unsigned Offset);