From: Devang Patel Date: Wed, 6 Jun 2007 20:08:11 +0000 (+0000) Subject: Add new dominator tree node into dominator tree node map. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7d832fe6c1a15c5d0ae65d5c71fd7dcec12c551e;p=oota-llvm.git Add new dominator tree node into dominator tree node map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37475 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp index b9cbde44add..c75143e5b6a 100644 --- a/lib/VMCore/Dominators.cpp +++ b/lib/VMCore/Dominators.cpp @@ -289,7 +289,9 @@ void DominatorTree::calculate(Function& F) { // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode - BBNode = IDomNode->addChild(new DomTreeNode(I, IDomNode)); + DomTreeNode *C = new DomTreeNode(I, IDomNode); + DomTreeNodes[I] = C; + BBNode = IDomNode->addChild(C); } } @@ -338,7 +340,9 @@ DomTreeNode *DominatorTree::getNodeForBlock(BasicBlock *BB) { // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode - return BBNode = IDomNode->addChild(new DomTreeNode(BB, IDomNode)); + DomTreeNode *C = new DomTreeNode(BB, IDomNode); + DomTreeNodes[BB] = C; + return BBNode = IDomNode->addChild(C); } static std::ostream &operator<<(std::ostream &o,