diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-30 22:08:08 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-30 22:08:08 +0000 |
commit | 358fc38d3b93cd264f0e9ea823c1d581c77be1f9 (patch) | |
tree | 8c64df342dc3bb3e6a16cb77f7d0180cb50f3e8b /lib/Analysis/DataStructure/Local.cpp | |
parent | dfd2f32bf74d2cc925a000d6e47fb74b156ce997 (diff) |
Add GlobalDSGraph -- a common graph that holds externally visible nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3173 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 296195cb1f..eb3d5b7374 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -109,10 +109,14 @@ namespace { //===----------------------------------------------------------------------===// // DSGraph constructor - Simply use the GraphBuilder to construct the local // graph. -DSGraph::DSGraph(Function &F) : Func(F), RetNode(0) { - // Use the graph builder to construct the local version of the graph - GraphBuilder B(*this, Nodes, RetNode, ValueMap, FunctionCalls); - markIncompleteNodes(); +DSGraph::DSGraph(Function &F, GlobalDSGraph* GlobalsG) + : Func(F), RetNode(0), GlobalsGraph(GlobalsG) { + if (GlobalsGraph != this) { + GlobalsGraph->addReference(this); + // Use the graph builder to construct the local version of the graph + GraphBuilder B(*this, Nodes, RetNode, ValueMap, FunctionCalls); + markIncompleteNodes(); + } } |