Add support for 'rename'
[oota-llvm.git] / lib / Analysis / DataStructure / DataStructureStats.cpp
index 674f689a685d4100fe32905869ff3585ac7dbe16..a48223e0edfc43bbd45a32f6e03784654749326d 100644 (file)
@@ -1,4 +1,11 @@
 //===- DSGraphStats.cpp - Various statistics for DS Graphs ----------------===//
+// 
+//                     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.
+// 
+//===----------------------------------------------------------------------===//
 //
 //===----------------------------------------------------------------------===//
 
@@ -11,6 +18,7 @@
 #include "llvm/Support/InstVisitor.h"
 #include "Support/Statistic.h"
 #include <vector>
+using namespace llvm;
 
 namespace {
   Statistic<> TotalNumCallees("totalcallees",
@@ -68,7 +76,7 @@ void DSGraphStats::countCallees(const Function& F) {
 
   const std::vector<DSCallSite> &callSites = TDGraph->getFunctionCalls();
   for (unsigned i = 0, N = callSites.size(); i != N; ++i)
-    if (isIndirectCallee(callSites[i].getCallInst().getCalledValue())) {
+    if (isIndirectCallee(callSites[i].getCallSite().getCalledValue())) {
       // This is an indirect function call
       const std::vector<GlobalValue*> &Callees =
         callSites[i].getCalleeNode()->getGlobals();
@@ -76,8 +84,9 @@ void DSGraphStats::countCallees(const Function& F) {
         totalNumCallees  += Callees.size();
         ++numIndirectCalls;
       } else
-        std::cerr << "WARNING: No callee in Function " << F.getName()
-                  << "at call:\n" << callSites[i].getCallInst();
+        std::cerr << "WARNING: No callee in Function '" << F.getName()
+                  << "' at call: \n"
+                  << *callSites[i].getCallSite().getInstruction();
     }
   
   TotalNumCallees  += totalNumCallees;
@@ -103,7 +112,7 @@ DSNode *DSGraphStats::getNodeForValue(Value *V) {
 
 bool DSGraphStats::isNodeForValueCollapsed(Value *V) {
   if (DSNode *N = getNodeForValue(V))
-    return N->isNodeCompletelyFolded();
+    return N->isNodeCompletelyFolded() || N->isIncomplete();
   return false;
 }