From 934487a9cc05c8c1696b09073a9ff6ecee8ef905 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 29 Sep 2002 21:37:08 +0000 Subject: [PATCH] Simplify code a bit, add an assertion git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3974 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/Dominators.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 5fd70864695..81f0eaf76dd 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -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 -- 2.34.1