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 | b82a4961324a0c842574d30e7e352f465d93b942 (patch) | |
tree | 7f5769df058c3445a5596ba9d0e6d0d33f5c3dfb /llvm/lib/Analysis/DataStructure/Local.cpp | |
parent | 256776e91f627d0f0bc35299f9bb965469914ae2 (diff) | |
download | bcm5719-llvm-b82a4961324a0c842574d30e7e352f465d93b942.tar.gz bcm5719-llvm-b82a4961324a0c842574d30e7e352f465d93b942.zip |
Add GlobalDSGraph -- a common graph that holds externally visible nodes.
llvm-svn: 3173
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Local.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 296195cb1f9..eb3d5b7374a 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/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(); + } } |