summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-09 21:12:07 +0000
committerChris Lattner <sabre@nondot.org>2002-11-09 21:12:07 +0000
commit4b1be35569e5b534a30d48c1975b9ffe041e7aec (patch)
tree77e464bbef50249341fa42da7b0c6e8dca0eb9b4 /llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
parentac64873403f30b201574a6811015be895c7c07f5 (diff)
downloadbcm5719-llvm-4b1be35569e5b534a30d48c1975b9ffe041e7aec.tar.gz
bcm5719-llvm-4b1be35569e5b534a30d48c1975b9ffe041e7aec.zip
Add globals graphs to all three passes
llvm-svn: 4663
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
index d57b6186f86..ade6ca68a5c 100644
--- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -18,6 +18,18 @@ X("budatastructure", "Bottom-up Data Structure Analysis Closure");
using namespace DS;
+// run - Calculate the bottom up data structure graphs for each function in the
+// program.
+//
+bool BUDataStructures::run(Module &M) {
+ GlobalsGraph = new DSGraph();
+
+ // Simply calculate the graphs for each function...
+ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
+ if (!I->isExternal())
+ calculateGraph(*I);
+ return false;
+}
// releaseMemory - If the pass pipeline is done with this pass, we can release
// our memory... here...
@@ -30,17 +42,8 @@ void BUDataStructures::releaseMemory() {
// Empty map so next time memory is released, data structures are not
// re-deleted.
DSInfo.clear();
-}
-
-// run - Calculate the bottom up data structure graphs for each function in the
-// program.
-//
-bool BUDataStructures::run(Module &M) {
- // Simply calculate the graphs for each function...
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isExternal())
- calculateGraph(*I);
- return false;
+ delete GlobalsGraph;
+ GlobalsGraph = 0;
}
DSGraph &BUDataStructures::calculateGraph(Function &F) {
@@ -52,6 +55,7 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
// Copy the local version into DSInfo...
Graph = new DSGraph(getAnalysis<LocalDataStructures>().getDSGraph(F));
+ Graph->setGlobalsGraph(GlobalsGraph);
#if 0
// Populate the GlobalsGraph with globals from this one.
OpenPOWER on IntegriCloud