Add a new DSNode::removeGlobal method.
authorChris Lattner <sabre@nondot.org>
Sun, 20 Mar 2005 03:29:54 +0000 (03:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Mar 2005 03:29:54 +0000 (03:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20710 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index 5cb6af6b194e79db81b666b09da1db358a05bd93..416766b166cb19493293b9f3ab60b82976815cc4 100644 (file)
@@ -157,6 +157,15 @@ void DSNode::addGlobal(GlobalValue *GV) {
   }
 }
 
+// removeGlobal - Remove the specified global that is explicitly in the globals
+// list.
+void DSNode::removeGlobal(GlobalValue *GV) {
+  std::vector<GlobalValue*>::iterator I =
+    std::lower_bound(Globals.begin(), Globals.end(), GV);
+  assert(I != Globals.end() && *I == GV && "Global not in node!");
+  Globals.erase(I);
+}
+
 /// 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