summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 20:01:01 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 20:01:01 +0000
commite742f31e0ca75028b078a8f9c6419622c28dc9c5 (patch)
treea2216c0a619bdbca7d4defde812297d9eafd33d5 /llvm/lib/Analysis/DataStructure/Local.cpp
parent5737a600d71bf3c927482961aca34aafa7342b69 (diff)
downloadbcm5719-llvm-e742f31e0ca75028b078a8f9c6419622c28dc9c5.tar.gz
bcm5719-llvm-e742f31e0ca75028b078a8f9c6419622c28dc9c5.zip
Add initial support for a globals graph
llvm-svn: 4656
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 224ec4ab9c3..0c0c6afd888 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -131,7 +131,7 @@ namespace {
//===----------------------------------------------------------------------===//
// DSGraph constructor - Simply use the GraphBuilder to construct the local
// graph.
-DSGraph::DSGraph(Function &F) : Func(&F) {
+DSGraph::DSGraph(Function &F, DSGraph *GG) : Func(&F), GlobalsGraph(GG) {
// Use the graph builder to construct the local version of the graph
GraphBuilder B(*this, Nodes, RetNode, ScalarMap, FunctionCalls);
markIncompleteNodes();
@@ -416,12 +416,16 @@ void LocalDataStructures::releaseMemory() {
// Empty map so next time memory is released, data structures are not
// re-deleted.
DSInfo.clear();
+ delete GlobalsGraph;
+ GlobalsGraph = 0;
}
bool LocalDataStructures::run(Module &M) {
+ GlobalsGraph = new DSGraph();
+
// Calculate all of the graphs...
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal())
- DSInfo.insert(std::make_pair(I, new DSGraph(*I)));
+ DSInfo.insert(std::make_pair(I, new DSGraph(*I, GlobalsGraph)));
return false;
}
OpenPOWER on IntegriCloud