From: Vikram S. Adve Date: Tue, 30 Jul 2002 22:08:08 +0000 (+0000) Subject: Add GlobalDSGraph -- a common graph that holds externally visible nodes. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=358fc38d3b93cd264f0e9ea823c1d581c77be1f9;p=oota-llvm.git 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 --- diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 296195cb1f9..eb3d5b7374a 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(); + } }