本文整理汇总了C++中DSGraph::getFunctionCalls方法的典型用法代码示例。如果您正苦于以下问题:C++ DSGraph::getFunctionCalls方法的具体用法?C++ DSGraph::getFunctionCalls怎么用?C++ DSGraph::getFunctionCalls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DSGraph
的用法示例。
在下文中一共展示了DSGraph::getFunctionCalls方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printCollection
static void printCollection(const Collection &C, llvm::raw_ostream &O,
const Module *M, const std::string &Prefix) {
if (M == 0) {
O << "Null Module pointer, cannot continue!\n";
return;
}
unsigned TotalNumNodes = 0, TotalCallNodes = 0;
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
if (C.hasDSGraph(*I)) {
DSGraph* Gr = C.getDSGraph((const Function&)*I);
unsigned NumCalls = Gr->shouldUseAuxCalls() ?
Gr->getAuxFunctionCalls().size() : Gr->getFunctionCalls().size();
bool IsDuplicateGraph = false;
//if no only print options, print everything
bool doPrint = OnlyPrint.begin() == OnlyPrint.end();
//otherwise check the name
if (!doPrint)
doPrint = OnlyPrint.end() !=
std::find(OnlyPrint.begin(), OnlyPrint.end(), I->getName().str());
if (doPrint) {
const Function *SCCFn = Gr->retnodes_begin()->first;
if (&*I == SCCFn) {
Gr->writeGraphToFile(O, Prefix+I->getName().str());
} else {
IsDuplicateGraph = true; // Don't double count node/call nodes.
O << "Didn't write '" << Prefix+I->getName().str()
<< ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName().str()
<< "\n";
}
} else {
const Function *SCCFn = Gr->retnodes_begin()->first;
if (&*I == SCCFn) {
//O << "Skipped Writing '" << Prefix+I->getName().str() << ".dot'... ["
// << Gr->getGraphSize() << "+" << NumCalls << "]\n";
} else {
IsDuplicateGraph = true; // Don't double count node/call nodes.
}
}
if (!IsDuplicateGraph) {
unsigned GraphSize = Gr->getGraphSize();
if (MaxGraphSize < GraphSize) MaxGraphSize = GraphSize;
TotalNumNodes += Gr->getGraphSize();
TotalCallNodes += NumCalls;
for (DSGraph::node_iterator NI = Gr->node_begin(), E = Gr->node_end();
NI != E; ++NI)
if (NI->isNodeCompletelyFolded())
++NumFoldedNodes;
}
}
DSGraph* GG = C.getGlobalsGraph();
TotalNumNodes += GG->getGraphSize();
TotalCallNodes += GG->getFunctionCalls().size();
GG->writeGraphToFile(O, Prefix + "GlobalsGraph");
O << "\nGraphs contain [" << TotalNumNodes << "+" << TotalCallNodes
<< "] nodes total\n";
}