Add ability to remove nodes from DominatorTree, for when a BasicBlock
authorNick Lewycky <nicholas@mxc.ca>
Tue, 12 Sep 2006 00:18:28 +0000 (00:18 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 12 Sep 2006 00:18:28 +0000 (00:18 +0000)
is being removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30270 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index 085225505e3f0b256572cee60299cd869fdddfec..55650f40b55e069ed7c9fb44d4a22df8f8006395 100644 (file)
@@ -399,6 +399,14 @@ public:
     N->setIDom(NewIDom);
   }
 
+  /// removeNode - Removes a node from the dominator tree.  Block must not
+  /// dominate any other blocks.  Invalidates any node pointing to removed
+  /// block.
+  void removeNode(BasicBlock *BB) {
+    assert(getNode(BB) && "Removing node that isn't in dominator tree.");
+    Nodes.erase(BB);
+  }
+
   /// print - Convert to human readable form
   ///
   virtual void print(std::ostream &OS, const Module* = 0) const;