From: Michael Liao Date: Thu, 7 Jan 2016 19:21:29 +0000 (+0000) Subject: [DominatorTree] Remove unnecessary map population. NFC. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=e310804af05622fd5056ac0ef8950ff5fc998fec [DominatorTree] Remove unnecessary map population. NFC. - The reason of population these maps seems not valid any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257086 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/GenericDomTree.h b/include/llvm/Support/GenericDomTree.h index 8751f272cd2..8bae582d18c 100644 --- a/include/llvm/Support/GenericDomTree.h +++ b/include/llvm/Support/GenericDomTree.h @@ -724,25 +724,17 @@ public: if (!this->IsPostDominators) { // Initialize root NodeT *entry = TraitsTy::getEntryNode(&F); - this->Roots.push_back(entry); - this->IDoms[entry] = nullptr; - this->DomTreeNodes[entry] = nullptr; + addRoot(entry); Calculate(*this, F); } else { // Initialize the roots list for (typename TraitsTy::nodes_iterator I = TraitsTy::nodes_begin(&F), E = TraitsTy::nodes_end(&F); - I != E; ++I) { + I != E; ++I) if (TraitsTy::child_begin(&*I) == TraitsTy::child_end(&*I)) addRoot(&*I); - // Prepopulate maps so that we don't get iterator invalidation issues - // later. - this->IDoms[&*I] = nullptr; - this->DomTreeNodes[&*I] = nullptr; - } - Calculate>(*this, F); } }