//===- 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.
+//
+//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/InstVisitor.h"
#include "Support/Statistic.h"
#include <vector>
+using namespace llvm;
namespace {
Statistic<> TotalNumCallees("totalcallees",
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();
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;
bool DSGraphStats::isNodeForValueCollapsed(Value *V) {
if (DSNode *N = getNodeForValue(V))
- return N->isNodeCompletelyFolded();
+ return N->isNodeCompletelyFolded() || N->isIncomplete();
return false;
}