aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-29 21:37:08 +0000
committerChris Lattner <sabre@nondot.org>2002-09-29 21:37:08 +0000
commit934487a9cc05c8c1696b09073a9ff6ecee8ef905 (patch)
tree5108edb1001dfcbdb08d1d8926111ae7f9798874 /include
parent4b28793c85d264f5f6285e4e7367df34a1c7057f (diff)
downloadexternal_llvm-934487a9cc05c8c1696b09073a9ff6ecee8ef905.zip
external_llvm-934487a9cc05c8c1696b09073a9ff6ecee8ef905.tar.gz
external_llvm-934487a9cc05c8c1696b09073a9ff6ecee8ef905.tar.bz2
Simplify code a bit, add an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/Dominators.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 5fd7086..81f0eaf 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