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 | 63aeacfe3da3e400d62de8ee3e65fd7602464f48 (patch) | |
tree | 6dc4f80688bf5a86d08ca6130245e6abf5bf03c4 /llvm/lib/Analysis/DataStructure/Local.cpp | |
parent | 151576413e9d408a604a5aa46544fe5a67b3efe3 (diff) | |
download | bcm5719-llvm-63aeacfe3da3e400d62de8ee3e65fd7602464f48.tar.gz bcm5719-llvm-63aeacfe3da3e400d62de8ee3e65fd7602464f48.zip |
Revamp DSGraphs so that they can support multiple functions in the same
DSGraph at one time
llvm-svn: 6994
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index a7751f23f7c..2b81d1423ce 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -62,25 +62,26 @@ namespace { /// graph by performing a single pass over the function in question. /// class GraphBuilder : InstVisitor<GraphBuilder> { + Function &F; DSGraph &G; std::vector<DSNode*> &Nodes; DSNodeHandle &RetNode; // Node that gets returned... - hash_map<Value*, DSNodeHandle> &ScalarMap; + DSGraph::ScalarMapTy &ScalarMap; std::vector<DSCallSite> &FunctionCalls; public: - GraphBuilder(DSGraph &g, std::vector<DSNode*> &nodes, DSNodeHandle &retNode, - hash_map<Value*, DSNodeHandle> &SM, + GraphBuilder(Function &f, DSGraph &g, std::vector<DSNode*> &nodes, + DSNodeHandle &retNode, DSGraph::ScalarMapTy &SM, std::vector<DSCallSite> &fc) - : G(g), Nodes(nodes), RetNode(retNode), ScalarMap(SM), FunctionCalls(fc) { + : F(f), G(g), Nodes(nodes), RetNode(retNode), ScalarMap(SM), + FunctionCalls(fc) { // Create scalar nodes for all pointer arguments... - for (Function::aiterator I = G.getFunction().abegin(), - E = G.getFunction().aend(); I != E; ++I) + for (Function::aiterator I = F.abegin(), E = F.aend(); I != E; ++I) if (isPointerType(I->getType())) getValueDest(*I); - visit(G.getFunction()); // Single pass over the function + visit(F); // Single pass over the function } private: @@ -139,10 +140,10 @@ namespace { //===----------------------------------------------------------------------===// // DSGraph constructor - Simply use the GraphBuilder to construct the local // graph. -DSGraph::DSGraph(Function &F, DSGraph *GG) : Func(&F), GlobalsGraph(GG) { +DSGraph::DSGraph(Function &F, DSGraph *GG) : GlobalsGraph(GG) { PrintAuxCalls = false; // Use the graph builder to construct the local version of the graph - GraphBuilder B(*this, Nodes, RetNode, ScalarMap, FunctionCalls); + GraphBuilder B(F, *this, Nodes, ReturnNodes[&F], ScalarMap, FunctionCalls); #ifndef NDEBUG Timer::addPeakMemoryMeasurement(); #endif |