aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2006-09-12 00:18:28 +0000
committerNick Lewycky <nicholas@mxc.ca>2006-09-12 00:18:28 +0000
commitf19fb9b4f45acce221ba3c20f37d66ffc1735b54 (patch)
tree3ddcb632521f5e9bdb0c204b416564c86fcf1bd0
parent0bfd7fde43436ee810c3e50dc595330ec048c576 (diff)
Add ability to remove nodes from DominatorTree, for when a BasicBlock
is being removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30270 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/Dominators.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 085225505e..55650f40b5 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -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;