aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp12
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();
+ }
}