Simplify code a bit, add an assertion

llvm-svn: 3974
This commit is contained in:
Chris Lattner 2002-09-29 21:37:08 +00:00
parent fc2aac7f8f
commit 85dd58c2cb
1 changed files with 2 additions and 3 deletions

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