Assert sooner. Fix wordings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-08-14 16:53:52 +00:00
parent 4d29ddfa06
commit 6d6403c287

View File

@ -565,7 +565,8 @@ static void PrintDomTree(const DomTreeNode *N, std::ostream &o,
void DominatorTreeBase::eraseNode(BasicBlock *BB) {
DomTreeNode *Node = getNode(BB);
assert (Node && "Removing node that isn't in dominator tree.");
assert (Node->getChildren().empty() && "Node is not a leaf node.");
// Remove node from immediate dominator's children list.
DomTreeNode *IDom = Node->getIDom();
if (IDom) {
@ -577,8 +578,6 @@ void DominatorTreeBase::eraseNode(BasicBlock *BB) {
IDom->Children.erase(I);
}
assert (Node->getChildren().empty() && "Children list is not empty");
DomTreeNodes.erase(BB);
delete Node;
}