Fix name collision
[oota-llvm.git] / lib / Analysis / DataStructure / BottomUpClosure.cpp
index dd141f2daf697d1af5bcd9a29fb6c16a9bd80428..b4b2e48b4efedb2717450a7ac4f8f17de6b6037a 100644 (file)
@@ -1,4 +1,11 @@
 //===- BottomUpClosure.cpp - Compute bottom-up interprocedural closure ----===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file implements the BUDataStructures class, which represents the
 // Bottom-Up Interprocedural closure of the data structure graph over the
@@ -48,6 +55,14 @@ bool BUDataStructures::run(Module &M) {
     }
 
   NumCallEdges += ActualCallees.size();
+
+  // At the end of the bottom-up pass, the globals graph becomes complete.
+  // FIXME: This is not the right way to do this, but it is sorta better than
+  // nothing!  In particular, externally visible globals and unresolvable call
+  // nodes at the end of the BU phase should make things that they point to
+  // incomplete in the globals graph.
+  // 
+  GlobalsGraph->maskIncompleteMarkers();
   return false;
 }
 
@@ -253,7 +268,8 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
       Graph.mergeInGraph(CS, *Callee, Graph, 0);
 
     } else {
-      ActualCallees.insert(std::make_pair(&CS.getCallInst(), Callee));
+      ActualCallees.insert(std::make_pair(CS.getCallSite().getInstruction(),
+                                          Callee));
 
       // Get the data structure graph for the called function.
       //