diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-08 05:01:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-08 05:01:14 +0000 |
commit | f8c6aab05e2625611ac98b0b56c9c7376192afc0 (patch) | |
tree | ac48c4577364aac3e8d105774dbf0da80b1501a3 /lib/Analysis/DataStructure/TopDownClosure.cpp | |
parent | 5134006f9389efec48d0a7bb1abfd3bd23028ea1 (diff) |
Use DSNodeHandleMap instead to be safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/TopDownClosure.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp index bc27b92ccd..98fec671b5 100644 --- a/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -93,7 +93,7 @@ DSGraph &TDDataStructures::calculateGraph(Function &F) { 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 @@ DSGraph &TDDataStructures::calculateGraph(Function &F) { } // 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 @@ DSGraph &TDDataStructures::calculateGraph(Function &F) { // 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); |