Simplify code a bit, add an assertion

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3974 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-09-29 21:37:08 +00:00
parent 4b28793c85
commit 934487a9cc

View File

@ -296,9 +296,8 @@ public:
///
Node *createNewNode(BasicBlock *BB, Node *IDomNode) {
assert(getNode(BB) == 0 && "Block already in dominator tree!");
Node *New = Nodes[BB] = new Node(BB, IDomNode);
if (IDomNode) IDomNode->addChild(New);
return New;
assert(IDomNode && "Not immediate dominator specified for block!");
return Nodes[BB] = IDomNode->addChild(new Node(BB, IDomNode));
}
/// changeImmediateDominator - This method is used to update the dominator