Use DSNodeHandleMap instead to be safe


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp
index bc27b92..98fec67 100644
--- a/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -93,7 +93,7 @@
   DSGraph &BUGraph = BU.getDSGraph(F);
   
   // Copy the BU graph, keeping a mapping from the BUGraph to the current Graph
-  std::map<const DSNode*, DSNode*> BUNodeMap;
+  std::map<const DSNode*, DSNodeHandle> BUNodeMap;
   Graph = new DSGraph(BUGraph, BUNodeMap);
 
   // We only need the BUMap entries for the nodes that are used in call sites.
@@ -113,12 +113,12 @@
   }
 
   // Loop through te BUNodeMap, keeping only the nodes that are "Needed"
-  for (std::map<const DSNode*, DSNode*>::iterator I = BUNodeMap.begin();
+  for (std::map<const DSNode*, DSNodeHandle>::iterator I = BUNodeMap.begin();
        I != BUNodeMap.end(); )
     if (NeededNodes.count(I->first) && I->first)  // Keep needed nodes...
       ++I;
     else {
-      std::map<const DSNode*, DSNode*>::iterator J = I++;
+      std::map<const DSNode*, DSNodeHandle>::iterator J = I++;
       BUNodeMap.erase(J);
     }
 
@@ -167,7 +167,7 @@
     // These two maps keep track of where scalars in the old graph _used_
     // to point to, and of new nodes matching nodes of the old graph.
     std::map<Value*, DSNodeHandle> OldValMap;
-    std::map<const DSNode*, DSNode*> OldNodeMap;
+    std::map<const DSNode*, DSNodeHandle> OldNodeMap;
 
     // FIXME: Eventually use DSGraph::mergeInGraph here...
     // Graph->mergeInGraph(CallSiteInCG, CG, false);