diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-30 03:15:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-30 03:15:25 +0000 |
commit | 5a540633036ccd7482bd8e83913304a4ed3fc11c (patch) | |
tree | b33e418ba8a67500feedda5e0e8dec2bcf7d299c /lib/Analysis/DataStructure/TopDownClosure.cpp | |
parent | a321b04d60e41d76d4d53a0e7afd4c2ea5c159ad (diff) |
Revamp DSGraphs so that they can support multiple functions in the same
DSGraph at one time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/TopDownClosure.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp index 06de437d0c..85a79d1076 100644 --- a/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -57,6 +57,7 @@ void TDDataStructures::releaseMyMemory() { GlobalsGraph = 0; } +#if 0 /// ResolveCallSite - This method is used to link the actual arguments together /// with the formal arguments for a function call in the top-down closure. This /// method assumes that the call site arguments have been mapped into nodes @@ -82,6 +83,7 @@ void TDDataStructures::ResolveCallSite(DSGraph &Graph, if (CallSite.getRetVal().getNode() && Graph.getRetNode().getNode()) Graph.getRetNode().mergeWith(CallSite.getRetVal()); } +#endif DSGraph &TDDataStructures::getOrCreateDSGraph(Function &F) { DSGraph *&G = DSInfo[&F]; @@ -169,13 +171,15 @@ void TDDataStructures::calculateGraph(Function &F) { << "'\n"); // Clone our current graph into the callee... - hash_map<Value*, DSNodeHandle> OldValMap; - hash_map<const DSNode*, DSNodeHandle> OldNodeMap; - CG.cloneInto(Graph, OldValMap, OldNodeMap, + DSGraph::ScalarMapTy OldValMap; + DSGraph::NodeMapTy OldNodeMap; + DSGraph::ReturnNodesTy ReturnNodes; + CG.cloneInto(Graph, OldValMap, ReturnNodes, OldNodeMap, DSGraph::StripModRefBits | DSGraph::KeepAllocaBit | DSGraph::DontCloneCallNodes | DSGraph::DontCloneAuxCallNodes); OldValMap.clear(); // We don't care about the ValMap + ReturnNodes.clear(); // We don't care about return values either // Loop over all of the invocation sites of the callee, resolving // arguments to our graph. This loop may iterate multiple times if the @@ -187,7 +191,7 @@ void TDDataStructures::calculateGraph(Function &F) { DSCallSite NewCS(*I->second, OldNodeMap); // Resolve the return values... - NewCS.getRetVal().mergeWith(CG.getRetNode()); + NewCS.getRetVal().mergeWith(CG.getReturnNodeFor(Callee)); // Resolve all of the arguments... Function::aiterator AI = Callee.abegin(); |