diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-09 21:12:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-09 21:12:07 +0000 |
commit | aa0b468f6d0e4d30d4f31d528d499e4c9a67c4f2 (patch) | |
tree | b0c006082bbc026983e495353411933f150e0872 /lib/Analysis/DataStructure/BottomUpClosure.cpp | |
parent | dc26d45c710fda254b235852dc830f4b2e4bcb03 (diff) | |
download | external_llvm-aa0b468f6d0e4d30d4f31d528d499e4c9a67c4f2.zip external_llvm-aa0b468f6d0e4d30d4f31d528d499e4c9a67c4f2.tar.gz external_llvm-aa0b468f6d0e4d30d4f31d528d499e4c9a67c4f2.tar.bz2 |
Add globals graphs to all three passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/BottomUpClosure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/BottomUpClosure.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index d57b618..ade6ca6 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/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. |