[DominatorTree] Remove unnecessary map population. NFC.
authorMichael Liao <michael.liao@intel.com>
Thu, 7 Jan 2016 19:21:29 +0000 (19:21 +0000)
committerMichael Liao <michael.liao@intel.com>
Thu, 7 Jan 2016 19:21:29 +0000 (19:21 +0000)
- 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

include/llvm/Support/GenericDomTree.h

index 8751f27..8bae582 100644 (file)
@@ -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<FT, NodeT *>(*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<FT, Inverse<NodeT *>>(*this, F);
     }
   }