From 358fc38d3b93cd264f0e9ea823c1d581c77be1f9 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Tue, 30 Jul 2002 22:08:08 +0000 Subject: [PATCH] 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 --- lib/Analysis/DataStructure/Local.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(); + } } -- 2.34.1