Simplify code a bit, add an assertion
authorChris Lattner <sabre@nondot.org>
Sun, 29 Sep 2002 21:37:08 +0000 (21:37 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 29 Sep 2002 21:37:08 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3974 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Dominators.h

index 5fd7086469523d9b2e0478d0d055fa2e44af9200..81f0eaf76dd1bdf895d1ace10b6d6ff44f3f1dce 100644 (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